From dcde33722b846d55d9aab43e0c2a62d418e085c2 Mon Sep 17 00:00:00 2001 From: Vitor M <4777793+vgmello@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:20:55 +0000 Subject: [PATCH] Fixing git workflow for release --- .github/workflows/build.yml | 12 ------------ .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c036981..a24852c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,15 +20,3 @@ jobs: run: dotnet build --no-restore - name: Test run: dotnet test --no-build --verbosity normal - - name: Publish - run: dotnet publish -c Release -r win-x64 -o output - - uses: kzrnm/get-net-sdk-project-versions-action@v1 - id: get-version - with: - proj-path: src/Ellosoft.AwsCredentialsManager/Ellosoft.AwsCredentialsManager.csproj - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3 - with: - name: aws-cred-mgr-${{steps.get-version.outputs.version}}${{ github.ref == 'refs/heads/main' && '' || ('-beta-' && github.run_attempt) }}-win.exe - path: output/*.exe - if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3aaedbb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: .NET +on: + push: + tags: + - "*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + dotnet-quality: "preview" + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release --no-restore + - name: Publish + run: dotnet publish -c Release -r win-x64 -o output --no-build + - name: Archive Release + uses: thedoctor0/zip-release@0.7.5 + with: + type: "zip" + path: output/aws-cred-mgr.exe + filename: "aws-cred-mgr-win-x64.zip" + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + prerelease: contains(github.ref, 'beta') || contains(github.ref, 'alpha') + files: aws-cred-mgr-win-x64.zip