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

(#285) Added additional publish step for GitHub package registry #286

Merged
merged 1 commit into from
Sep 27, 2021
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
7 changes: 1 addition & 6 deletions .build/pre-release.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#!/usr/bin/env bash
set -ex

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm whoami

npm ci
patchVersion=$(npm --no-git-tag version patch)
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
echo "${nextVersion:1}"

npm version --no-git-tag -f "${nextVersion:1}"
npm run publish-next
npm version --no-git-tag -f "${nextVersion:1}"
14 changes: 13 additions & 1 deletion .github/workflows/snapshot_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,21 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Install
run: npm ci
- name: Install @nut-tree/libnut@next
run: npm i @nut-tree/libnut@next
- name: Publish snapshot release
run: bash ./.build/pre-release.sh
- name: Publish tagged release to npm
run: npm run publish-next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v2
with:
registry-url: 'https://npm.pkg.github.com'
- name: Publish tagged release to GPR
run: npm run publish-next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 11 additions & 3 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Install
run: npm ci
- name: Run typedoc
Expand All @@ -62,7 +63,14 @@ jobs:
deploy_key: ${{ secrets.API_DOC_DEPLOY_KEY }}
external_repository: nut-tree/apidoc
publish_dir: ./docs
- name: Publish tagged release
uses: JS-DevTools/npm-publish@v1
- name: Publish tagged release to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v2
with:
token: ${{ secrets.NPM_TOKEN }}
registry-url: 'https://npm.pkg.github.com'
- name: Publish tagged release to GPR
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}