Skip to content

Commit

Permalink
Chore: add fixit-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Feb 18, 2025
1 parent b369181 commit 26f3d3e
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This is a basic workflow to help you get started with Actions

name: Release for new tag

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
tags:
- 'v*.*.*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for generating release notes

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Generate Changelog
run: |
pnpm release --starting-version ${{ github.ref_name }}
sed -i '1,4d' CHANGELOG.md
- name: GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
# Creates a draft release. Defaults to false
draft: true
body_path: CHANGELOG.md
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message="Chore(release): %s"
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
"theme-component"
],
"main": "index.js",
"engines": {
"node": ">=18"
},
"scripts": {
"cp": "cp node_modules/i18n-jsautotranslate/index.js assets/lib/translate.js",
"lint": "eslint assets/js",
"lint:fix": "eslint assets/js --fix"
"lint:fix": "eslint assets/js --fix",
"release": "fixit-releaser changelog"
},
"devDependencies": {
"@antfu/eslint-config": "^4.2.1",
"@hugo-fixit/fixit-releaser": "^1.1.2",
"eslint": "^9.20.1",
"i18n-jsautotranslate": "^3.13.6"
}
Expand Down
Loading

0 comments on commit 26f3d3e

Please sign in to comment.