Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-publish unstable packages to NPM #625

Merged
merged 1 commit into from
Apr 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/publish-unstable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# For every push to the master branch, this publishes an NPM package to the
# "unstable" NPM tag.

name: Publish Unstable

on:
push:
branches:
- main
- master

jobs:
publish:
name: "NPM Publish"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: yarn install --frozen-lockfile

# We need a workspace aware version of npm because our addon is in a subdir but our .npmrc is in the root
- name: npm8
run: npm install -g npm@8

- name: set version
run: npm version --no-git-tag-version --workspaces-update=false `node -e "console.log(require('./package.json').version)"`-unstable.`git rev-parse --short HEAD`
working-directory: addon

- name: npm publish
run: npm publish --tag=unstable --verbose --workspace=addon
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
7 changes: 6 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ 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.

## Docs site
## Docs Site

Once release is done, you should update docs side.

Expand All @@ -83,3 +83,8 @@ Once release is done, you should update docs side.

From there, GitHub Pages takes care of deploying documentation site to [http://adopted-ember-addons.github.io/ember-keyboard/](http://adopted-ember-addons.github.io/ember-keyboard/).
You may check the deploy status via GitHub actions [pages-build-deployment workflow](https://github.com/adopted-ember-addons/ember-keyboard/actions/workflows/pages/pages-build-deployment).

## Unstable Tag

For every push to the master branch, [`Publish Unstable`](./.github/workflows/publish-unstable.yml)
publishes an NPM package to the "unstable" NPM tag.