71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
name: Release Bundled Action
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
steps:
|
|
# 1️⃣ Checkout repository
|
|
- uses: actions/checkout@v4
|
|
|
|
# 2️⃣ Set up Node
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
# 3️⃣ Install dependencies
|
|
- run: npm ci
|
|
|
|
# 4️⃣ Bundle the action via ncc
|
|
- name: Bundle the action
|
|
run: npx @vercel/ncc build action.js -o dist
|
|
|
|
# 5️⃣ Commit dist/ back to repo
|
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
with:
|
|
commit_message: "Build dist for release ${{ github.ref_name }}"
|
|
file_pattern: dist/**
|
|
branch: main # Push to main, not the tag
|
|
commit_user_name: github-actions[bot]
|
|
commit_user_email: github-actions[bot]@users.noreply.github.com
|
|
push: true
|
|
|
|
# 6️⃣ Create Gitea release & generate changelog/release notes
|
|
- name: Gitea Release & Versioning
|
|
uses: joaquinjsb/gitea-release-please-action@v4
|
|
id: gitea_release
|
|
with:
|
|
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
|
release-type: simple
|
|
github-api-url: ${{ gitea.api_url }}
|
|
branch: main # Point to main branch
|
|
config-file: release-please-config.json
|
|
|
|
# 7️⃣ Create GitHub release with release notes
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ steps.gitea_release.outputs.tag_name }}
|
|
name: Release ${{ steps.gitea_release.outputs.tag_name }}
|
|
body: ${{ steps.gitea_release.outputs.release_notes }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.RENOVATE_BOT_TOKEN }}
|
|
|
|
# 8️⃣ Auto-update major tag for workflows
|
|
- name: Update major version tag
|
|
run: |
|
|
tag="${{ steps.gitea_release.outputs.tag_name }}"
|
|
major="v${tag#v}"
|
|
major="${major%%.*}"
|
|
echo "Updating major tag: $major → $tag"
|
|
git tag -f "$major"
|
|
git push -f origin "$major"
|