Skip to content

Commit

Permalink
ci: build beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 17, 2024
1 parent e5fe9ea commit f4d5654
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
56 changes: 54 additions & 2 deletions .github/workflows/beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ 'main' ]

jobs:
release:
changelog:
strategy:
matrix:
platform: [ ubuntu-latest ]
Expand Down Expand Up @@ -33,4 +33,56 @@ jobs:
TAG_NAME: beta
with:
prerelease: true
body_path: CHANGELOG.md
body_path: CHANGELOG.md

- name: Upload assets
uses: softprops/action-gh-release@v2
with:
files: CHANGELOG.md

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/*
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ if [ "$1" = "dev" ]; then
BuildDocker
elif [ "$2" = "docker-multiplatform" ]; then
BuildDockerMultiplatform
elif [ "$2" = "web" ]; then
echo "web only"
else
BuildDev
fi
Expand All @@ -285,6 +287,8 @@ elif [ "$1" = "release" ]; then
elif [ "$2" = "android" ]; then
BuildReleaseAndroid
MakeRelease "md5-android.txt"
elif [ "$2" = "web" ]; then
echo "web only"
else
BuildRelease
MakeRelease "md5.txt"
Expand All @@ -293,6 +297,8 @@ elif [ "$1" = "prepare" ]; then
if [ "$2" = "docker-multiplatform" ]; then
PrepareBuildDockerMusl
fi
elif [ "$1" = "zip" ]; then
MakeRelease "$2".txt
else
echo -e "Parameter error"
fi

0 comments on commit f4d5654

Please sign in to comment.