-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3dff699
commit 8222622
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Publish | ||
|
||
# TODO change this trigger later | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
NPM_TOKEN: ${{ secrets.CLPLAYERS_NPM_TOKEN_RW }} | ||
# VERSION: ${{ github.event.release.tag_name }} | ||
VERSION: 0.7.7 | ||
|
||
jobs: | ||
publish-to-npm: | ||
name: Publish to NPM | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: npm | ||
|
||
- name: Write NPM RC | ||
run: | | ||
echo '@castlabs:registry=https://registry.npmjs.org' > .npmrc | ||
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc | ||
- name: Overwrite package.json Version | ||
uses: castlabs/ref-to-version-action@main | ||
with: | ||
versionFile: package.json | ||
from-tag: ${{ env.VERSION }} | ||
|
||
# TODO remove this debug | ||
- name: Debug Echo Version | ||
run: echo ${{ env.VERSION }} | ||
|
||
- name: NPM Install | ||
run: npm ci | ||
|
||
# TODO NOT dry run | ||
- name: Publish to NPM | ||
run: npm publish --dry-run | ||
|
||
- name: Job Summary | ||
run: | | ||
echo '### NPM Release' >> $GITHUB_STEP_SUMMARY | ||
echo "Released \`@castlabs/prestoplay-react-components@${{ env.VERSION }}\` to NPM" >> $GITHUB_STEP_SUMMARY | ||
# publish_api_docs: | ||
# name: Publish API Docs | ||
# runs-on: [ubuntu-latest] | ||
# steps: |