diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml deleted file mode 100644 index abb9459..0000000 --- a/.github/workflows/build-docker.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Build Docker Image - -on: [push, pull_request] - -jobs: - build: - name: Build and Test - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Docker Build - run: docker build -t kaiheila-onebot . - - name: Export Image - run: | - mkdir image - docker save kaiheila-onebot > ./image/kaiheila-onebot-docker.tar - - name: Archive production artifacts - uses: actions/upload-artifact@v2 - with: - name: kaiheila-onebot-docker-${{ github.sha }} - path: image diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml deleted file mode 100644 index cdaed0f..0000000 --- a/.github/workflows/build-package.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build Package - -on: [push, pull_request] - -jobs: - build: - name: Build and Pack - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '5.0' - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build ./src/kaiheila-onebot.csproj --configuration Release --no-restore - - name: Pack - run: dotnet pack ./src/kaiheila-onebot.csproj --configuration Release --no-restore - - name: Copy files - run: | - mkdir -p src/bin/publish - rm -rf src/bin/Release/net5.0 - cp src/bin/Release/* src/bin/publish - - name: Archive production artifacts - uses: actions/upload-artifact@v2 - with: - name: kaiheila-onebot-nupkg-${{ github.sha }} - path: src/bin/publish diff --git a/.github/workflows/build-binary.yml b/.github/workflows/build.yml similarity index 59% rename from .github/workflows/build-binary.yml rename to .github/workflows/build.yml index c3d188b..243394a 100644 --- a/.github/workflows/build-binary.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build Binary +name: Build on: [push, pull_request] @@ -22,9 +22,59 @@ jobs: run: dotnet build ./src/kaiheila-onebot.csproj --configuration Release --no-restore - name: Test run: dotnet test ./test/kaiheila-onebot-test.csproj --no-restore --verbosity normal + + pack: + name: Build Package + + needs: [build] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '5.0' + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build ./src/kaiheila-onebot.csproj --configuration Release --no-restore + - name: Pack + run: dotnet pack ./src/kaiheila-onebot.csproj -o src/bin/publish/ --configuration Release --no-restore + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: kaiheila-onebot-nupkg-${{ github.sha }} + path: src/bin/publish + + docker: + name: Build Image + + needs: [build] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Docker Build + run: docker build -t kaiheila-onebot . + - name: Export Image + run: | + mkdir image + docker save kaiheila-onebot > ./image/kaiheila-onebot-docker.tar + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: kaiheila-onebot-docker-${{ github.sha }} + path: image publish: - name: Publish + name: Build Binary strategy: matrix: