Skip to content

Commit 130854e

Browse files
committed
chore: auto releases
1 parent 0b360f6 commit 130854e

File tree

3 files changed

+181
-0
lines changed

3 files changed

+181
-0
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
interval: 'daily'
7+
commit-message:
8+
prefix: 'chore'
9+
include: 'scope'
10+
- package-ecosystem: 'npm'
11+
directory: '/'
12+
schedule:
13+
interval: 'daily'
14+
commit-message:
15+
prefix: 'chore'
16+
include: 'scope'
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Test & Maybe Release
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
node: [20.x, lts/*, current]
9+
# not quite windows ready, halp! os: [macos-latest, ubuntu-latest, windows-latest]
10+
os: [macos-latest, ubuntu-latest]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Use Node.js ${{ matrix.node }}
18+
uses: actions/[email protected]
19+
with:
20+
node-version: ${{ matrix.node }}
21+
- name: Set up ghauth config (Ubuntu)
22+
run: |
23+
mkdir -p ~/.config/changelog-maker/
24+
echo '{"user": "nodejs", "token": "'${{ secrets.GITHUB_TOKEN }}'"}' > ~/.config/changelog-maker/config.json
25+
if: startsWith(matrix.os, 'ubuntu')
26+
27+
- name: Set up ghauth config (macOS)
28+
run: |
29+
mkdir -p ~/Library/Application\ Support/changelog-maker/
30+
echo '{"user": "nodejs", "token": "'${{ secrets.GITHUB_TOKEN }}'"}' > ~/Library/Application\ Support/changelog-maker/config.json
31+
if: startsWith(matrix.os, 'macos')
32+
33+
- name: Set up ghauth config (Windows)
34+
run: |
35+
mkdir "%LOCALAPPDATA%\changelog-maker\"
36+
echo {"user": "nodejs", "token": "${{ secrets.GITHUB_TOKEN }}"} > "%LOCALAPPDATA%\changelog-maker\config.json"
37+
shell: cmd
38+
if: startsWith(matrix.os, 'windows')
39+
- name: Install Dependencies
40+
run: |
41+
npm install --no-progress
42+
- name: Run tests
43+
run: |
44+
npm config set script-shell bash
45+
npm run test:ci
46+
release:
47+
name: Release
48+
needs: test
49+
runs-on: ubuntu-latest
50+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
- name: Setup Node.js
57+
uses: actions/[email protected]
58+
with:
59+
node-version: lts/*
60+
- name: Install dependencies
61+
run: |
62+
npm install --no-progress --no-package-lock --no-save
63+
- name: Build
64+
run: |
65+
npm run build
66+
- name: Install plugins
67+
run: |
68+
npm install \
69+
@semantic-release/commit-analyzer \
70+
conventional-changelog-conventionalcommits \
71+
@semantic-release/release-notes-generator \
72+
@semantic-release/npm \
73+
@semantic-release/github \
74+
@semantic-release/git \
75+
@semantic-release/changelog \
76+
--no-progress --no-package-lock --no-save
77+
- name: Release
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
81+
run: npx semantic-release
82+

package.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"semver": "^7.3.2"
1919
},
2020
"scripts": {
21+
"build": "true",
2122
"lint": "standard",
23+
"test:ci": "npm run test",
2224
"test": "npm run lint && node ls-types.js && node transform-filename.js && node decode-ref.js && node is-security-release.js"
2325
},
2426
"bin": {
@@ -28,5 +30,86 @@
2830
"preferGlobal": true,
2931
"devDependencies": {
3032
"standard": "^14.3.4"
33+
},
34+
"release": {
35+
"branches": [
36+
"main"
37+
],
38+
"plugins": [
39+
[
40+
"@semantic-release/commit-analyzer",
41+
{
42+
"preset": "conventionalcommits",
43+
"releaseRules": [
44+
{
45+
"breaking": true,
46+
"release": "major"
47+
},
48+
{
49+
"revert": true,
50+
"release": "patch"
51+
},
52+
{
53+
"type": "feat",
54+
"release": "minor"
55+
},
56+
{
57+
"type": "fix",
58+
"release": "patch"
59+
},
60+
{
61+
"type": "chore",
62+
"release": "patch"
63+
},
64+
{
65+
"type": "docs",
66+
"release": "patch"
67+
},
68+
{
69+
"type": "test",
70+
"release": "patch"
71+
},
72+
{
73+
"scope": "no-release",
74+
"release": false
75+
}
76+
]
77+
}
78+
],
79+
[
80+
"@semantic-release/release-notes-generator",
81+
{
82+
"preset": "conventionalcommits",
83+
"presetConfig": {
84+
"types": [
85+
{
86+
"type": "feat",
87+
"section": "Features"
88+
},
89+
{
90+
"type": "fix",
91+
"section": "Bug Fixes"
92+
},
93+
{
94+
"type": "chore",
95+
"section": "Trivial Changes"
96+
},
97+
{
98+
"type": "docs",
99+
"section": "Trivial Changes"
100+
},
101+
{
102+
"type": "test",
103+
"section": "Tests"
104+
}
105+
]
106+
}
107+
}
108+
],
109+
"@semantic-release/changelog",
110+
"@semantic-release/npm",
111+
"@semantic-release/github",
112+
"@semantic-release/git"
113+
]
31114
}
32115
}

0 commit comments

Comments
 (0)