Skip to content

Commit

Permalink
Merge pull request #237 from babel/kg-add-ci-releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
kategengler authored Aug 17, 2023
2 parents 905315f + bc8d0e3 commit 66485e8
Show file tree
Hide file tree
Showing 5 changed files with 11,537 additions and 11,330 deletions.
11 changes: 6 additions & 5 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 @@ -20,11 +21,11 @@ jobs:
strategy:
matrix:
os: ['ubuntu', 'windows', 'macOS']
node: ['14', '16', '18']
node: ['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.
Loading

0 comments on commit 66485e8

Please sign in to comment.