From 6b5c9c023064022ece0a33e9401f2fa8dd260122 Mon Sep 17 00:00:00 2001 From: Vitaliya Chumakova Date: Mon, 16 Aug 2021 21:32:13 +0300 Subject: [PATCH] Bump, automatically create github release --- .github/workflows/dotnet.yml | 91 +++++++++++++++++++++++++--- FriendAccepter/FriendAccepter.csproj | 3 +- 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 01c076c..65fbfc0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -10,29 +10,102 @@ env: DOTNET_SDK_VERSION: 5.0.x jobs: - build: + build-generic-netf: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 + - name: Checkout submodules run: git submodule update --init --recursive + - name: Setup .NET uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ env.DOTNET_SDK_VERSION }} + - name: Restore dependencies run: dotnet restore - - name: Build with .NET Core - run: dotnet publish -c Release -f net5.0 -o out/generic + - name: Build with .NET Framework run: dotnet publish -c Release -f net48 -o out/generic-netf - - name: Upload generic artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ github.event.repository.name }}-generic - path: out/generic + - name: Upload generic-netf artifacts uses: actions/upload-artifact@v2 with: name: ${{ github.event.repository.name }}-generic-netf path: out/generic-netf + + build-generic: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Checkout submodules + run: git submodule update --init --recursive + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DOTNET_SDK_VERSION }} + + - name: Restore dependencies + run: dotnet restore + + - name: Build with .NET Core + run: dotnet publish -c Release -f net5.0 -o out/generic + + - name: Upload generic artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ github.event.repository.name }}-generic + path: out/generic + + release: + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} + needs: [build-generic-netf, build-generic] + runs-on: ubuntu-latest + + steps: + - name: Download generic artifacts + uses: actions/download-artifact@v2.0.10 + with: + name: ${{ github.event.repository.name }}-generic + path: out + + - name: Download generic-netf artifacts + uses: actions/download-artifact@v2.0.10 + with: + name: ${{ github.event.repository.name }}-generic-netf + path: out + + - name: Create GitHub release + id: github_release + uses: actions/create-release@v1.1.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.event.repository.name }} V${{ github.ref }} + prerelease: true + + - name: Upload generic artifacts to GitHub release + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.github_release.outputs.upload_url }} + asset_path: out/generic.zip + asset_name: generic.zip + asset_content_type: application/zip + + - name: Upload generic-netf artifacts to GitHub release + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.github_release.outputs.upload_url }} + asset_path: out/generic-netf.zip + asset_name: generic-netf.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/FriendAccepter/FriendAccepter.csproj b/FriendAccepter/FriendAccepter.csproj index 983ba7c..447b717 100644 --- a/FriendAccepter/FriendAccepter.csproj +++ b/FriendAccepter/FriendAccepter.csproj @@ -1,11 +1,10 @@  - 1.1.0.0 - 1.1.0.0 enable net5.0;net48 latest + 1.1.1.0