mirror of
https://git.fightbot.fun/hxuanyu/BingPaper.git
synced 2026-02-15 05:59:32 +08:00
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25.5'
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: webapp/package-lock.json
|
|
|
|
- name: Build and Package
|
|
run: |
|
|
chmod +x scripts/build.sh
|
|
./scripts/build.sh ${{ github.ref_name }}
|
|
|
|
- name: Generate Changelog
|
|
id: changelog
|
|
run: |
|
|
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
if [ -z "$PREV_TAG" ]; then
|
|
git log --pretty=format:"* %s (%h)" > CHANGELOG.md
|
|
else
|
|
git log --pretty=format:"* %s (%h)" $PREV_TAG..HEAD > CHANGELOG.md
|
|
fi
|
|
echo "CHANGELOG_PATH=CHANGELOG.md" >> $GITHUB_ENV
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
body_path: CHANGELOG.md
|
|
files: output/*.tar.gz
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|