chore: initial setup for fork release workflow.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"packages": {
|
||||
".": {
|
||||
"release-type": "simple",
|
||||
"bump-minor-pre-major": true,
|
||||
"changelog-type": "github-changelog",
|
||||
"include-component-in-tag": false,
|
||||
"changelog-path": "CHANGELOG.md",
|
||||
"version-file": "package.json",
|
||||
"pull-request-title-pattern": "chore(release): {{version}}",
|
||||
"tag-separator": "",
|
||||
"monorepo-tags": false
|
||||
}
|
||||
},
|
||||
"branch": "main",
|
||||
"semantic": "true",
|
||||
"changelog-preserve-commits": false,
|
||||
"update-notes": true
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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
|
||||
- uses: vercel/ncc@v0.34.0
|
||||
with:
|
||||
command: build
|
||||
input: action.js
|
||||
output: 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: ${{ github.ref_name }}
|
||||
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.GITEA_TOKEN }}
|
||||
release-type: simple
|
||||
github-api-url: ${{ secrets.GITEA_API_URL }}
|
||||
branch: ${{ github.ref_name }}
|
||||
config-file: release-please-config.json
|
||||
|
||||
# 7️⃣ Create GitHub release with release notes
|
||||
- name: Create GitHub Release
|
||||
uses: actions/create-release@v2
|
||||
with:
|
||||
tag_name: ${{ steps.gitea_release.outputs.tag_name }}
|
||||
release_name: "Release ${{ steps.gitea_release.outputs.tag_name }}"
|
||||
body: ${{ steps.gitea_release.outputs.release_notes }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
# 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"
|
||||
Reference in New Issue
Block a user