prerender-proxy-1.0.2 #203
Workflow file for this run
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: Publish to NPM | |
on: | |
release: | |
tags: | |
- '**-[0-9]+.[0-9]+.[0-9]+' | |
- '**-[0-9]+.[0-9]+.[0-9]+-*' | |
types: [published] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
# Source checkout | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.release.target_commitish }} | |
# Setting Node environment | |
- name: Setting up Node environment | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
# Environment configuration | |
- name: Preparing environment for release | |
run: | | |
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "PACKAGE=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV | |
# Release process | |
- name: Release | |
run: | | |
npm ci | |
git config --global user.name "Automated NPM Release" | |
git config --global user.email "[email protected]" | |
npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${{env.PACKAGE}}" | |
npm run build --workspace "@aligent/cdk-${{env.PACKAGE}}" | |
npm test --workspace "@aligent/cdk-${{env.PACKAGE}}" --if-present | |
npm publish --access public --workspace "@aligent/cdk-${{env.PACKAGE}}" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: git push | |
env: | |
github-token: ${{ secrets.GITHUB_TOKEN }} |