## 0.15.1: github 打包 #21
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
name: CI Create Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
frontend-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Setup pnpm | |
run: npm install -g pnpm | |
- name: Build | |
run: | | |
cd ui && pnpm i && pnpm run build:prod | |
- name: Upload frontend build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend-artifact | |
path: ./ui/dist | |
server-build: | |
runs-on: ubuntu-latest | |
needs: frontend-build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
cache: true | |
- name: Setup GF | |
run: wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(go env GOOS)_$(go env GOARCH) && chmod +x gf && ./gf install -y && rm ./gf | |
- name: Download frontend build | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-artifact | |
path: ./ui/dist | |
- name: Build | |
run: | | |
gf pack ./ui/dist ./packed/dist.go | |
gf build -s linux,windows -a amd64,arm64 --gf.gcfg.file=gf.yaml -p ./temp | |
python release.py | |
- name: Upload server build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: server-artifact | |
path: | | |
./temp | |
release: | |
runs-on: ubuntu-latest | |
needs: [server-build] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download server build | |
uses: actions/download-artifact@v3 | |
with: | |
name: server-artifact | |
path: ./temp | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{secrets.TOKEN}} | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref_name }} | |
# body_path: ./build/changelog.md | |
draft: false | |
prerelease: false | |
files: | | |
./temp/* |