Skip to content

Commit dbfd31a

Browse files
committed
feat: update automated workflow and release configuration for improved semantic release handling
1 parent 341b1d7 commit dbfd31a

2 files changed

Lines changed: 35 additions & 12 deletions

File tree

‎.github/workflows/automated.yml‎

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Automated Workflow
2+
23
on:
34
push:
45
branches:
56
- master
7+
68
jobs:
79
about:
810
runs-on: ubuntu-latest
@@ -18,25 +20,37 @@ jobs:
1820
with:
1921
direction: overwrite-github
2022
githubToken: "${{ secrets.GITHUB }}"
23+
2124
release:
2225
runs-on: ubuntu-latest
2326
steps:
2427
- name: Checkout
2528
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # Required so semantic-release can trace git tags/history
31+
2632
- name: Setup Node.js
2733
uses: actions/setup-node@v4
2834
with:
29-
node-version: 22 # Required for the latest semantic-release plugins
30-
- name: Semantic Release
31-
uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
32-
id: semantic
33-
with:
34-
extra_plugins: |
35-
@semantic-release/changelog
35+
node-version: 22
36+
37+
- name: Install Semantic Release & Plugins
38+
# Installs semantic-release and its plugins on the runner
39+
run: |
40+
npm install -g semantic-release \
41+
@semantic-release/changelog \
42+
@semantic-release/npm \
43+
@semantic-release/github \
3644
@semantic-release/git
37-
@semantic-release/github
45+
46+
- name: Run Semantic Release (Native)
47+
id: semantic
48+
# This will automatically pick up your export default config file in the repository root
49+
run: npx semantic-release
3850
env:
39-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Use the built-in token if possible
51+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
52+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
53+
4054
outputs:
4155
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
42-
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
56+
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"

‎release.config.js‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ module.exports = {
1010
changelogFile: "CHANGELOG.md",
1111
},
1212
],
13-
"@semantic-release/github",
13+
"@semantic-release/npm",
1414
[
15-
"@semantic-release/git",
15+
"@semantic-release/github",
1616
{
17+
successComment: false,
18+
failTitle: false,
19+
},
20+
],
21+
[
22+
"@semantic-release/git",
23+
{
24+
// Only stage and commit the changelog and package.json
1725
assets: ["CHANGELOG.md", "package.json"],
26+
message: "chore(release): ${nextRelease.version} [skip ci]",
1827
},
1928
],
2029
],

0 commit comments

Comments
 (0)