mirror of
https://github.com/nianzhibai/91.git
synced 2026-06-15 00:44:30 +08:00
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23.x"
|
|
cache-dependency-path: backend/go.sum
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
|
|
- name: Build release packages
|
|
run: scripts/build-release.sh
|
|
|
|
- name: Upload release assets
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG: ${{ github.ref_name }}
|
|
run: |
|
|
git tag -d "$TAG" >/dev/null 2>&1 || true
|
|
git fetch --force origin "refs/tags/$TAG:refs/tags/$TAG"
|
|
NOTES="$(git tag -l "$TAG" --format='%(contents)')"
|
|
if [ -z "$NOTES" ]; then
|
|
NOTES="Prebuilt Linux release packages."
|
|
fi
|
|
gh release delete "$TAG" --yes >/dev/null 2>&1 || true
|
|
gh release create "$TAG" release/*.tar.gz --title "$TAG" --notes "$NOTES" --verify-tag
|