chore: migrate from node to bun
Some checks failed
Lint / lint (pull_request) Failing after 5s

This commit is contained in:
2026-03-25 10:38:27 +01:00
parent e69826b824
commit 77b77a17f4
5 changed files with 157 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
name: Publish npm package
name: Publish
on:
push:
@@ -43,6 +43,9 @@ jobs:
- name: Build
run: bun run build
- name: Build binaries
run: bun run binaries
- name: Configure Gitea registry auth
run: |
echo "//git.blassanto.me/api/packages/blas/npm/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.bunfig.toml
@@ -52,7 +55,37 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
- name: Publish to Gitea
- name: Publish to Gitea registry
run: bun publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
- name: Create Gitea release and upload binaries
run: |
VERSION=${GITHUB_REF_NAME#v}
RELEASE_ID=$(curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"https://git.blassanto.me/api/v1/repos/blas/openapi-clean-arch-gen/releases" \
-d "{
\"tag_name\": \"${GITHUB_REF_NAME}\",
\"name\": \"v${VERSION}\",
\"body\": \"## Installation\n\nDownload the binary for your platform or install via the npm registry:\n\n\`\`\`bash\nbun add -g @blas/openapi-clean-arch-generator --registry https://git.blassanto.me/api/packages/blas/npm/\n\`\`\`\",
\"draft\": false,
\"prerelease\": false
}" | bun -e "let d='';process.stdin.on('data',c=>d+=c).on('end',()=>console.log(JSON.parse(d).id))")
echo "Created release ID: $RELEASE_ID"
for BINARY in dist/bin/*; do
FILENAME=$(basename "$BINARY")
echo "Uploading $FILENAME..."
curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${BINARY};filename=${FILENAME}" \
"https://git.blassanto.me/api/v1/repos/blas/openapi-clean-arch-gen/releases/${RELEASE_ID}/assets"
done
env:
GITEA_TOKEN: ${{ secrets.TOKEN }}