update workflow

This commit is contained in:
WJQSERVER 2025-02-09 22:24:10 +08:00
parent 47173092a3
commit fbda6d29c0
2 changed files with 55 additions and 0 deletions

View file

@ -9,8 +9,36 @@ on:
- 'DEV-VERSION' - 'DEV-VERSION'
jobs: jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 加载版本号
run: |
if [ -f DEV-VERSION ]; then
echo "VERSION=$(cat DEV-VERSION)" >> $GITHUB_ENV
else
echo "DEV-VERSION file not found!" && exit 1
fi
- name: 输出版本号
run: |
echo "Version: ${{ env.VERSION }}"
- name: 预先创建Pre-release
id: create_release
uses: ncipollo/release-action@v1
with:
name: ${{ env.VERSION }}
artifacts: ./DEV-VERSION
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.VERSION }}
allowUpdates: true
prerelease: true
env:
export PATH: $PATH:/usr/local/go/bin
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: prepare
strategy: strategy:
matrix: matrix:
goos: [linux, darwin, freebsd] goos: [linux, darwin, freebsd]

View file

@ -9,8 +9,35 @@ on:
- 'VERSION' - 'VERSION'
jobs: jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 加载版本号
run: |
if [ -f VERSION ]; then
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
else
echo "VERSION file not found!" && exit 1
fi
- name: 输出版本号
run: |
echo "Version: ${{ env.VERSION }}"
- name: 预先创建release
id: create_release
uses: ncipollo/release-action@v1
with:
name: ${{ env.VERSION }}
artifacts: ./VERSION
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.VERSION }}
allowUpdates: true
env:
export PATH: $PATH:/usr/local/go/bin
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: prepare # 确保这个作业在 prepare 作业完成后运行
strategy: strategy:
matrix: matrix:
goos: [linux, darwin, freebsd] goos: [linux, darwin, freebsd]