update app name in release.yml #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/release.yml | |
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' # 触发标签格式为 v开头,如 v1.0.0 | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # 获取所有历史记录用于生成更新日志 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18.x' | |
# 如果是跨平台编译 | |
- name: Build Binaries | |
run: | | |
# Linux | |
GOOS=linux GOARCH=amd64 go build -o ./bin/gojson-amd64 | |
# Windows | |
GOOS=windows GOARCH=amd64 go build -o ./bin/gojson-windows-amd64.exe | |
# macOS | |
GOOS=darwin GOARCH=amd64 go build -o ./bin/gojson-darwin-amd64 | |
# 自动生成更新日志 | |
- name: Generate Changelog | |
run: | | |
echo "## What's Changed" > CHANGELOG.md | |
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"* %s" >> CHANGELOG.md | |
# 创建 Release | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./bin/gojson-linux-amd64 | |
./bin/gojson-windows-amd64.exe | |
./bin/gojson-darwin-amd64 | |
body_path: CHANGELOG.md | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |