test: re-merge workflows into 'publish' for download-artifact

This commit is contained in:
Baipyrus 2024-09-01 15:52:01 +02:00
parent 1dc9c2f40b
commit 7bad3a40be
2 changed files with 20 additions and 27 deletions

View File

@ -1,7 +1,7 @@
# This workflow will build a golang project # 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 # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build name: Publish
on: on:
push: push:
@ -23,7 +23,7 @@ jobs:
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v4 uses: actions/setup-go@v5
with: with:
go-version: "${{ env.GO_VERSION }}" go-version: "${{ env.GO_VERSION }}"
@ -39,3 +39,21 @@ jobs:
with: with:
name: ProxySwitcher name: ProxySwitcher
path: build/* path: build/*
release:
runs-on: ubuntu-latest
needs: build
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

View File

@ -1,25 +0,0 @@
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