From 1dc9c2f40b5388a4985e95274f81f072cc0df1b1 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 1 Sep 2024 15:36:17 +0200 Subject: [PATCH] separate build and release steps --- .github/workflows/build.yml | 14 ++++++-------- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1350c36..fd58af2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go -name: Go +name: Build on: push: @@ -34,10 +34,8 @@ jobs: - name: Build project run: go build -o build/ -v ./... - - name: Create release with asset - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create "${{ github.ref_name }}" \ - --title "Release ${{ github.ref_name }}" \ - build/ProxySwitcher.exe + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ProxySwitcher + path: build/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2589061 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ProxySwitcher + + - name: Create release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${{ github.event.workflow_run.head_ref }}" \ + --title "Release ${{ github.event.workflow_run.head_ref }}" \ + ProxySwitcher