mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
chore: add GitHub Actions CI/CD workflows
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- run: bun install
|
||||
- run: bun run build:single-exe:all
|
||||
- name: Package binaries
|
||||
run: |
|
||||
cd cli/dist-exe
|
||||
for dir in bun-*/; do
|
||||
name="${dir%/}"
|
||||
if [[ "$name" == *"windows"* ]]; then
|
||||
zip -r "${name}.zip" "$dir"
|
||||
else
|
||||
tar -czvf "${name}.tar.gz" "$dir"
|
||||
fi
|
||||
done
|
||||
- name: Create Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release create "${GITHUB_REF#refs/tags/}" \
|
||||
--title "Release ${GITHUB_REF#refs/tags/}" \
|
||||
--generate-notes \
|
||||
cli/dist-exe/*.tar.gz \
|
||||
cli/dist-exe/*.zip
|
||||
Reference in New Issue
Block a user