ci: build beta release

pull/7035/head
Andy Hsu 2024-08-18 00:21:48 +08:00
parent e5fe9ea5f6
commit 4ba476e25c
2 changed files with 61 additions and 9 deletions

View File

@ -5,7 +5,7 @@ on:
branches: [ 'main' ] branches: [ 'main' ]
jobs: jobs:
release: changelog:
strategy: strategy:
matrix: matrix:
platform: [ ubuntu-latest ] platform: [ ubuntu-latest ]
@ -23,14 +23,60 @@ jobs:
run: | run: |
git tag -l git tag -l
npx changelogen@latest --output CHANGELOG.md npx changelogen@latest --output CHANGELOG.md
# env:
# GITHUB_TOKEN: ${{secrets.MY_TOKEN}}
- name: Prerelease - name: Upload assets
uses: tubone24/update_release@master uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
TAG_NAME: beta
with: with:
body_path: CHANGELOG.md
files: CHANGELOG.md
prerelease: true prerelease: true
body_path: CHANGELOG.md tag_name: beta
release:
needs:
- changelog
strategy:
matrix:
include:
- target: '!(*musl*|*windows-arm64*|*android*)' # xgo
hash: "md5"
- target: 'linux-*-musl*' #musl
hash: "md5-linux-musl"
- target: 'windows-arm64' #win-arm64
hash: "md5-windows-arm64"
- target: 'android-*' #android
hash: "md5-android"
name: Beta Release
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.22'
- name: Setup web
run: bash build.sh dev web
- name: Build
id: test-action
uses: go-cross/cgo-actions@v1
with:
targets: ${{ matrix.target }}
musl-target-format: $os-$musl-$arch
out-dir: build
- name: Compress
run: |
bash build.sh zip ${{ matrix.hash }}
- name: Upload assets
uses: softprops/action-gh-release@v2
with:
files: build/compress/*
prerelease: true
tag_name: beta

View File

@ -267,6 +267,8 @@ if [ "$1" = "dev" ]; then
BuildDocker BuildDocker
elif [ "$2" = "docker-multiplatform" ]; then elif [ "$2" = "docker-multiplatform" ]; then
BuildDockerMultiplatform BuildDockerMultiplatform
elif [ "$2" = "web" ]; then
echo "web only"
else else
BuildDev BuildDev
fi fi
@ -285,6 +287,8 @@ elif [ "$1" = "release" ]; then
elif [ "$2" = "android" ]; then elif [ "$2" = "android" ]; then
BuildReleaseAndroid BuildReleaseAndroid
MakeRelease "md5-android.txt" MakeRelease "md5-android.txt"
elif [ "$2" = "web" ]; then
echo "web only"
else else
BuildRelease BuildRelease
MakeRelease "md5.txt" MakeRelease "md5.txt"
@ -293,6 +297,8 @@ elif [ "$1" = "prepare" ]; then
if [ "$2" = "docker-multiplatform" ]; then if [ "$2" = "docker-multiplatform" ]; then
PrepareBuildDockerMusl PrepareBuildDockerMusl
fi fi
elif [ "$1" = "zip" ]; then
MakeRelease "$2".txt
else else
echo -e "Parameter error" echo -e "Parameter error"
fi fi