Skip to content

Commit 9860b22

Browse files
authored
chore(ci): Add manual tag and release workflow
This workflow allows for manual tagging and releasing of the project, including generating automatic changelog and creating a GitHub release based on user input.
1 parent 36c7eee commit 9860b22

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Manual Tag & Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
create_github_release:
7+
description: 'Create a GitHub Release?'
8+
required: true
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write # Required to push commits and tags
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # Fetches all history for accurate changelog generation
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
28+
- name: Generate Changelog and Tag
29+
id: changelog
30+
uses: TriPSs/conventional-changelog-action@v5
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
git-user-name: 'github-actions[bot]'
34+
git-user-email: 'github-actions[bot]@users.noreply.github.com'
35+
git-message: 'chore(release): {version}'
36+
skip-on-empty: 'false'
37+
preset: 'conventionalcommits'
38+
skip-ci: 'false'
39+
tag-prefix: 'v'
40+
version-file: './package.json, ./package-lock.json'
41+
42+
- name: Create GitHub Release
43+
if: ${{ github.event.inputs.create_github_release == 'true' && steps.changelog.outputs.skipped == 'false' }}
44+
uses: softprops/action-gh-release@v1
45+
with:
46+
tag_name: ${{ steps.changelog.outputs.tag }}
47+
body: ${{ steps.changelog.outputs.clean_changelog }}
48+
generate_release_notes: true

0 commit comments

Comments
 (0)