Skip to content

Commit

Permalink
chore: add release workflow for github releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadi-E committed Jun 12, 2024
1 parent 666e386 commit e93e654
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ jobs:
run: ./node_modules/.bin/commitlint --from $(git merge-base --fork-point master) --verbose
- name: Lint
run: npm run lint
- name: Lint
uses: wearerequired/[email protected]
with:
continue_on_error: false
auto_fix: false
neutral_check_on_warning: false
eslint: true
eslint_args: src/**/*.ts
eslint_extensions: ts
prettier: true
prettier_args: src/**/*.ts
prettier_extensions: ts
- name: Test
run: |
npm test
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ on:
branches:
- master

workflow_dispatch:


permissions:
packages: write
contents: write
issues: write
pull-requests: write

jobs:
release-and-publish:
name: Release and publish to NPM registry
Expand All @@ -24,6 +33,6 @@ jobs:
run: npm ci
- name: Release and publish to NPM registry
env:
NPM_LOGIN_TOKEN: ${{ secrets.NPM_LOGIN_TOKEN }}
NPM_LOGIN_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SUPERCHARGE_BOT_DEPLOY_KEY: ${{ secrets.SUPERCHARGE_BOT_DEPLOY_KEY }}
run: ./release.sh
8 changes: 4 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -euo pipefail

# configure Git user and e-mail for the release commit
git config user.name "supercharge-bot"
git config user.email [email protected]
git config user.name "zenobe-bot"
git config user.email [email protected]

# generate changelog and new version number then create a release commit
npm run release
Expand All @@ -19,7 +19,7 @@ mkdir -p ~/.ssh/
ssh-keyscan github.com >> ~/.ssh/known_hosts

# push the release commit and the new tag to the upstream
git push --follow-tags [email protected]:team-supercharge/nest-amqp.git master
git push --follow-tags [email protected]:zenobeenergy/nest-amqp.git master

# delete all manually added SSH keys
ssh-add -D
Expand All @@ -42,7 +42,7 @@ cp package.json README.md LICENSE dist/
cd dist

# add auth token
echo "//registry.npmjs.org/:_authToken=${NPM_LOGIN_TOKEN}" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${NPM_LOGIN_TOKEN}" > .npmrc

# publish the package to NPM
npm publish
Expand Down

0 comments on commit e93e654

Please sign in to comment.