Skip to content

Commit 4431b7d

Browse files
authored
feat(ci-cd): add github release workflow (#180)
release will be via workflow BREAKING CHANGE: remove support for node 16 GH-179
1 parent 1ae9866 commit 4431b7d

File tree

2 files changed

+106
-7
lines changed

2 files changed

+106
-7
lines changed

.github/workflows/release.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This Manually Executable Workflow is for NPM Releases
2+
3+
name: Release [Manual]
4+
on: workflow_dispatch
5+
permissions:
6+
contents: write
7+
jobs:
8+
Release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
# fetch-depth is necessary to get all tags
14+
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
15+
fetch-depth: 0
16+
token: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
17+
- name: Setup Node
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '18.x'
21+
- name: Configure CI Git User
22+
run: |
23+
git config --global user.name $CONFIG_USERNAME
24+
git config --global user.email $CONFIG_EMAIL
25+
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/loopback4-microservice-catalog
26+
env:
27+
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
28+
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
29+
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
30+
- name: Authenticate with Registry
31+
run: |
32+
echo "@${NPM_USERNAME}:registry=https://registry.npmjs.org/" > .npmrc
33+
echo "registry=https://registry.npmjs.org/" >> .npmrc
34+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
35+
npm whoami
36+
env:
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
NPM_USERNAME: ${{ vars.NPM_USERNAME }}
39+
40+
- name: Install 📌
41+
run: |
42+
npm install
43+
- name: Test 🔧
44+
run: npm run test
45+
- name: Semantic Publish to NPM 🚀
46+
# "HUSKY=0" disables pre-commit-msg check (Needed in order to allow semantic-release perform the release commit)
47+
run: HUSKY=0 npx semantic-release
48+
env:
49+
GH_TOKEN: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
50+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)