Skip to content

Commit 7728604

Browse files
committed
ci(release): add changesets to automatically manage releases
1 parent b2a10fa commit 7728604

File tree

9 files changed

+2818
-71
lines changed

9 files changed

+2818
-71
lines changed

.changeset/config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "StackExchange/axe-apca" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main"
10+
}

.changeset/red-socks-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"axe-apca": patch
3+
---
4+
5+
Initial release

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- CI
7+
branches:
8+
- main
9+
types:
10+
- completed
11+
12+
jobs:
13+
release:
14+
name: Release
15+
# run only if the CI workflow is successful
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: ⬇️ Checkout
20+
uses: actions/checkout@v3
21+
# make sure to checkout the commit that triggered the CI workflow
22+
# (which is not necessarily the latest commit)
23+
with:
24+
ref: ${{ github.event.workflow_run.head_commit.id }}
25+
26+
- name: ⎔ Setup node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 'lts/*'
30+
31+
- name: 🏗 Install and Build
32+
run: |
33+
npm ci
34+
npm run build
35+
36+
- name: 🚀 Create/Update Release Pull Request or Publish to npm
37+
id: changesets
38+
uses: changesets/action@v1
39+
with:
40+
publish: npm publish
41+
version: npm version
42+
title: 'chore(new-release)'
43+
commit: 'chore(new-release)'
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_API_KEY }}
47+
48+
# cancel the jobs if another workflow is kicked off for the same branch
49+
concurrency:
50+
group: ${{ github.workflow }}-${{ github.ref }}
51+
cancel-in-progress: true

.idea/.idea.axe-apca.dir/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.axe-apca.dir/.idea/projectSettingsUpdater.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.axe-apca.dir/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.axe-apca.dir/.idea/workspace.xml

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)