Skip to content

Commit

Permalink
WIP publish to NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
fingerartur committed Nov 20, 2023
1 parent 3dff699 commit 8222622
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/publish.yml
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:

0 comments on commit 8222622

Please sign in to comment.