Skip to content

Commit

Permalink
CI Release Flow (AxisCommunications#89)
Browse files Browse the repository at this point in the history
* CI Release Flow

How it works:

1. Everytime a PR is merged, the changeset
   action creates (or updates) a PR with
   the generated changelogs for review.

2. When we are ready for a new release,
   we merge the changelog PR.

3. A new release is automatically built
   and uploaded to npm.

4. A GitHub release entry is automatically
   created.

Note: The generated changelogs are now
excluded from prettier, because forcing it
made the release process awkward. It does
not really matter that much, since the
changeset action seems to follow prettier's
standards close to 100%.

* Remove unneccessary comment
  • Loading branch information
GLundh authored Mar 11, 2024
1 parent 73b296f commit 485dbfc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install Dependencies
run: yarn install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn github-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ coverage
CODEOWNERS

.yarnrc.yml
.yarn/
.yarn/

**/CHANGELOG.md

.changeset/*.json
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"release": "changeset version && yarn prettier --write '{packages,plugins}/*/{package.json,CHANGELOG.md}' '.changeset/*.json' && yarn install --no-immutable",
"release": "changeset version && yarn prettier --write '{packages,plugins}/*/{package.json}' && yarn install --no-immutable",
"github-release": "yarn tsc && yarn build:all && changeset publish",
"new": "backstage-cli new --scope internal"
},
"workspaces": {
Expand Down

0 comments on commit 485dbfc

Please sign in to comment.