Skip to content

Release [Manual]

Release [Manual] #100

Workflow file for this run

# This Manually Executable Workflow is for NPM Releases
name: Release [Manual]
on: workflow_dispatch
permissions:
contents: write
jobs:
Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# fetch-depth is necessary to get all tags
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
fetch-depth: 0
token: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Configure CI Git User
run: |
git config --global user.name $CONFIG_USERNAME
git config --global user.email $CONFIG_EMAIL
git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_PAT@github.com/sourcefuse/loopback4-microservice-catalog
env:
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
- name: Authenticate with Registry
run: |
echo "@${NPM_USERNAME}:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_USERNAME: ${{ vars.NPM_USERNAME }}
- name: Bootstrap
run: npm ci
# this step is added only since this version of nx dependency is not being installed on linux systems
# can be removed once this issue is fixed or we update to later versions
- name: nx dependency
run: npm i @nx/nx-linux-x64-gnu@16.10.0
- name: Test
run: npm run test --workspaces --if-present
- name: Lint
run: npm run lint --workspaces --if-present
- name: Stash Changes
run: git stash
- name: Bump Versions
# "HUSKY=0" disables pre-commit-msg check (Needed in order to allow lerna perform the release commit)
run: HUSKY=0 npx lerna version --yes --ci --conventional-commits
- name: Publish to NPM 🚀
# To always compare changes from registry
# using `from-package` compares version in local package.json with registry and publish it if required.
run: npx lerna publish from-package --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}