Skip to content

Commit

Permalink
Add CI Releasing setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kategengler committed Aug 17, 2023
1 parent 905315f commit 19ce45c
Show file tree
Hide file tree
Showing 5 changed files with 11,534 additions and 11,327 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- main
- 'v*' # older version branches
tags:
- '*'
Expand All @@ -23,8 +24,8 @@ jobs:
node: ['14', '16', '18']

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: install dependencies
Expand All @@ -37,8 +38,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: install dependencies
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
push:
tags:
- '*'

jobs:
publish:
name: Publish to npm
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm install --no-package-lock

- name: auto-dist-tag
run: npx auto-dist-tag --write
working-directory: './addon/'

- name: publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
working-directory: './addon/'
6 changes: 5 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Once the prep work is completed, the actual release is straight forward:
* First, ensure that you have installed your projects dependencies:

```sh
npm install
yarn install
```

* Second, ensure that you have obtained a
Expand All @@ -58,3 +58,7 @@ release process. It will prompt you to to choose the version number after which
you will have the chance to hand tweak the changelog to be used (for the
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
pushing the tag and commits, etc.

Once the tag has been pushed, the GitHub workflow `publish.yml` will be triggered
to publish the package(s) to npm. This workflow does not wait for tests to pass, so
be sure to only run `release-it` on a passing build.

0 comments on commit 19ce45c

Please sign in to comment.