fix: remove workflow_dispatch + add push-only conditions on release steps

Gitea 1.25.2 does not support workflow_dispatch, which silently
prevented the workflow from being parsed. Also added if conditions
on release steps so they only run on push to main, not on PRs.

💘 Generated with Crush

Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
Augustin
2026-04-19 23:38:11 +02:00
parent 92275becb2
commit 9cd583f4f3

View File

@@ -5,7 +5,6 @@ on:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
@@ -34,6 +33,7 @@ jobs:
go vet ./...
- name: Build all platforms
if: github.event_name == 'push'
run: |
export PATH=/usr/local/go/bin:$PATH
mkdir -p dist
@@ -47,6 +47,7 @@ jobs:
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/muyue-windows-arm64.exe ./cmd/muyue/
- name: Package archives
if: github.event_name == 'push'
run: |
cd dist
sha256sum * > checksums.txt
@@ -59,6 +60,7 @@ jobs:
rm -f muyue-linux-amd64 muyue-linux-arm64 muyue-darwin-amd64 muyue-darwin-arm64 muyue-windows-amd64.exe muyue-windows-arm64.exe
- name: Delete old release
if: github.event_name == 'push'
env:
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
run: |
@@ -78,6 +80,7 @@ jobs:
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/tags/latest" > /dev/null 2>&1 || true
- name: Create release
if: github.event_name == 'push'
env:
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
run: |