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