Build Nezha #10
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: Build Nezha | |
on: workflow_dispatch | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Build Nezha | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Nezha | |
uses: vmactions/freebsd-vm@v1 | |
with: | |
usesh: true | |
release: 13.2 | |
prepare: | | |
pkg install -y node wget curl git go121 gcc bash gawk gsed | |
ln -s /usr/local/bin/go121 /usr/local/bin/go | |
run: | | |
export LATEST_APP=$(wget -qO- https://api.github.com/repos/naiba/nezha/tags | gawk -F '["v]' '/name/{print "v"$5;exit}') | |
git clone -b $LATEST_APP https://github.com/naiba/nezha | |
cd nezha/cmd/dashboard | |
bash ../../../build.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: nezha-freebsd | |
path: | | |
nezha/cmd/dashboard/dashboard | |
- name: Generate release tag | |
id: tag | |
run: echo "release_tag=$(wget -qO- https://api.github.com/repos/naiba/nezha/tags | gawk -F '["v]' '/name/{print "v"$5;exit}')" >> $GITHUB_OUTPUT | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: | | |
nezha/cmd/dashboard/dashboard | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 1 | |
keep_minimum_runs: 8 |