diff --git a/.github/workflows/dotnet-publish.yml b/.github/workflows/dotnet-publish.yml index 5bd0e3f3..79025913 100644 --- a/.github/workflows/dotnet-publish.yml +++ b/.github/workflows/dotnet-publish.yml @@ -15,34 +15,57 @@ env: jobs: build: - runs-on: windows-latest - steps: - uses: actions/checkout@v3 - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ env.DOTNET_VERSION }} - source-url: https://nuget.pkg.github.com//index.json env: NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Restore dependencies - run: dotnet restore ${{ DOTNET_SLN }} - + run: dotnet restore ${{ env.DOTNET_SLN }} - name: Build - run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ DOTNET_SLN }} - - - name: Test - run: dotnet test --configuration ${{ env.DOTNET_CONFIGURATION }} --no-build --verbosity normal ${{ DOTNET_SLN }} - - - name: Zip Artifact - run: zip -r Libation.${{ github.ref_name }}.zip ./Source/bin/${{ env.DOTNET_CONFIGURATION }}/* - + run: dotnet build --configuration ${{ env.DOTNET_CONFIGURATION }} --no-restore ${{ env.DOTNET_SLN }} - name: Publish Artifact uses: actions/upload-artifact@v3 with: - name: Libation ${{ github.ref_name }} - path: Libation.${{ github.ref_name }}.zip - if-no-files-found: error \ No newline at end of file + name: LibationZip + path: ./Source/bin/${{ env.DOTNET_CONFIGURATION }}/ + if-no-files-found: error + + publish: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: LibationZip + path: ./Libation-${{ github.ref_name }} + - name: Zip Artifact + run: zip -r Libation.${{ github.ref_name }}.zip ./Libation-${{ github.ref_name }} + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Libation ${{ github.ref }} + body: + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: Libation.${{ github.ref_name }}.zip + asset_name: Libation.${{ github.ref_name }}.zip + asset_content_type: application/zip \ No newline at end of file