separate build and release steps

This commit is contained in:
Baipyrus 2024-09-01 15:36:17 +02:00
parent 7b565f82f0
commit 1dc9c2f40b
2 changed files with 31 additions and 8 deletions

View File

@ -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/*

25
.github/workflows/release.yml vendored Normal file
View File

@ -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