-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/DO-1285-upgrade-cdk
- Loading branch information
Showing
10 changed files
with
66 additions
and
288 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
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 }} |
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