canary #6
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
name: canary | |
on: | |
workflow_dispatch: | |
jobs: | |
publish-canary: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
- name: Get git tags and set user | |
run: | | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
- run: yarn install --immutable --inline-builds --immutable-cache --check-cache | |
- run: yarn build:all | |
- run: yarn test:all | |
- name: Create .npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
echo "@danbileee:registry=https://registry.npmjs.org/" > .npmrc | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc | |
- name: Deploy | |
run: | | |
var=`npx lerna publish --canary --yes --preid canary` | |
echo $var > foo.txt | |
val=$( cat foo.txt ) | |
echo "DEPLOY_RESULT=$val" >> $GITHUB_ENV | |
- name: Delete .npmrc | |
if: always() | |
run: | | |
rm .npmrc | |
- run: echo "$DEPLOY_RESULT" |