Merge pull request #1495 from trheyi/main
feat(workflow): enhance release workflows with version tagging and de…
This commit is contained in:
commit
22aab3b431
3 changed files with 53 additions and 3 deletions
41
.github/workflows/release-linux.yml
vendored
41
.github/workflows/release-linux.yml
vendored
|
|
@ -37,7 +37,39 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
export PATH=$PATH:/github/home/go/bin
|
export PATH=$PATH:/github/home/go/bin
|
||||||
/app/build.sh
|
|
||||||
|
# Clone dependencies
|
||||||
|
cd /app
|
||||||
|
git clone https://github.com/yaoapp/kun.git /app/kun
|
||||||
|
git clone https://github.com/yaoapp/xun.git /app/xun
|
||||||
|
git clone https://github.com/yaoapp/gou.git /app/gou
|
||||||
|
git clone https://github.com/yaoapp/v8go.git /app/v8go
|
||||||
|
git clone https://github.com/yaoapp/cui.git /app/cui-v1.0
|
||||||
|
git clone https://github.com/yaoapp/yao-init.git /app/yao-init
|
||||||
|
git clone https://github.com/yaoapp/yao.git /app/yao
|
||||||
|
|
||||||
|
# Extract libv8
|
||||||
|
files=$(find /app/v8go -name "libv8*.zip")
|
||||||
|
for file in $files; do
|
||||||
|
dir=$(dirname "$file")
|
||||||
|
echo "Extracting $file to directory $dir"
|
||||||
|
unzip -o -d $dir $file
|
||||||
|
rm -rf $dir/__MACOSX
|
||||||
|
done
|
||||||
|
|
||||||
|
# Set VERSION from git tag (required)
|
||||||
|
cd /app/yao
|
||||||
|
if [[ "$GITHUB_REF" != refs/tags/v* ]]; then
|
||||||
|
echo "::error::This workflow requires a tag (refs/tags/v*). Got: $GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
||||||
|
echo "Setting VERSION to $TAG_VERSION"
|
||||||
|
sed -i "s/const VERSION = \".*\"/const VERSION = \"${TAG_VERSION}\"/g" share/const.go
|
||||||
|
grep 'const VERSION' share/const.go
|
||||||
|
|
||||||
|
make tools && make artifacts-linux
|
||||||
|
mv /app/yao/dist/release/* /data/
|
||||||
ls -l /data
|
ls -l /data
|
||||||
|
|
||||||
- name: Push To R2
|
- name: Push To R2
|
||||||
|
|
@ -66,8 +98,13 @@ jobs:
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep 'const VERSION =' share/const.go | awk '{print $4}' | sed 's/"//g')
|
if [[ "$GITHUB_REF" != refs/tags/v* ]]; then
|
||||||
|
echo "::error::This workflow requires a tag (refs/tags/v*). Got: $GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/v}"
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
echo "VERSION=${VERSION}"
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
|
||||||
12
.github/workflows/release-macos.yml
vendored
12
.github/workflows/release-macos.yml
vendored
|
|
@ -93,6 +93,18 @@ jobs:
|
||||||
- name: Checkout Yao
|
- name: Checkout Yao
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set Version from Tag
|
||||||
|
run: |
|
||||||
|
if [[ "$GITHUB_REF" != refs/tags/v* ]]; then
|
||||||
|
echo "::error::This workflow requires a tag (refs/tags/v*). Got: $GITHUB_REF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
TAG="${GITHUB_REF#refs/tags/v}"
|
||||||
|
echo "Setting VERSION to $TAG"
|
||||||
|
sed -i.bak "s/const VERSION = \".*\"/const VERSION = \"${TAG}\"/g" share/const.go
|
||||||
|
rm -f share/const.go.bak
|
||||||
|
grep 'const VERSION' share/const.go
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
|
|
@ -26,9 +26,10 @@ jobs:
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.workflow_run.head_branch }}"
|
TAG="${{ github.event.workflow_run.head_branch }}"
|
||||||
VERSION=$(grep 'const VERSION =' share/const.go | awk '{print $4}' | sed 's/"//g')
|
VERSION="${TAG#v}"
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
|
echo "TAG=${TAG} VERSION=${VERSION}"
|
||||||
|
|
||||||
- name: Wait for Both Workflows
|
- name: Wait for Both Workflows
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue