Skip to content

Commit

Permalink
ci(release): add changesets to automatically manage releases
Browse files Browse the repository at this point in the history
  • Loading branch information
giamir committed Oct 12, 2023
1 parent b2a10fa commit 7728604
Show file tree
Hide file tree
Showing 9 changed files with 2,818 additions and 71 deletions.
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "StackExchange/axe-apca" }
],
"commit": false,
"access": "public",
"baseBranch": "main"
}
5 changes: 5 additions & 0 deletions .changeset/red-socks-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"axe-apca": patch
---

Initial release
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
workflow_run:
workflows:
- CI
branches:
- main
types:
- completed

jobs:
release:
name: Release
# run only if the CI workflow is successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v3
# make sure to checkout the commit that triggered the CI workflow
# (which is not necessarily the latest commit)
with:
ref: ${{ github.event.workflow_run.head_commit.id }}

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: 🏗 Install and Build
run: |
npm ci
npm run build
- name: 🚀 Create/Update Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm publish
version: npm version
title: 'chore(new-release)'
commit: 'chore(new-release)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_API_KEY }}

# cancel the jobs if another workflow is kicked off for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
8 changes: 8 additions & 0 deletions .idea/.idea.axe-apca.dir/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.axe-apca.dir/.idea/projectSettingsUpdater.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.axe-apca.dir/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions .idea/.idea.axe-apca.dir/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7728604

Please sign in to comment.