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