Update release workflow for main branch builds

Modified the release workflow to use 'goreleaser release' for main branch builds and added a step to update the 'latest' prerelease on GitHub with development builds from the main branch. This improves automation and makes the latest development artifacts easily accessible for testing.
This commit is contained in:
lx1056758714-glitch
2025-12-18 22:17:27 +08:00
parent 367fcc2e5a
commit a5dc514fcb

View File

@@ -41,13 +41,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser (Snapshot)
if: "!startsWith(github.ref, 'refs/tags/')"
run: goreleaser build --snapshot --clean
- name: Run GoReleaser (Main Branch Build)
if: github.ref == 'refs/heads/main'
run: goreleaser release --snapshot --clean
- name: Update Latest Release
if: github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: latest
name: "Latest Development Build"
body: "这是来自 main 分支的最新自动构建版本。仅供开发测试使用。"
prerelease: true
make_latest: false
files: |
dist/**/*.exe
dist/**/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts
if: "!startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v4
with:
name: chatlog-snapshot
path: dist/chatlog_windows_amd64_v1/chatlog.exe
path: dist/chatlog_windows_amd64_v1/chatlog.exe