-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from energywebfoundation/prepare_release
Prepare release
- Loading branch information
Showing
4 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
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,67 @@ | ||
name: NPM Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
jobs: | ||
cancel-previous: | ||
name: 'Cancel Previous Runs' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
steps: | ||
- uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
semantic-version: | ||
name: Semantic release | ||
runs-on: ubuntu-latest | ||
needs: [cancel-previous] | ||
timeout-minutes: 2 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_release_rules: major:major:Major Changes,minor:minor:Minor Changes,chore:patch:Chores | ||
outputs: | ||
new_version: ${{ steps.tag_version.outputs.new_version }} | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
needs: [cancel-previous, semantic-version] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 21.2.0 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Bump package version | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "ewf-devops" | ||
npm version "${{ needs.semantic-version.outputs.new_version }}" | ||
- name: Publish to NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} # Set your NPM token in repository secrets | ||
run: npm publish --access public # Add any additional flags you need |
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,7 @@ | ||
registry=https://registry.npmjs.org/ | ||
|
||
# Authentication token for publishing packages | ||
//registry.npmjs.org/:_authToken=${NPM_TOKEN} | ||
|
||
# Use a scoped registry for a specific scope | ||
@energyweb:registry=https://registry.npmjs.org/ |
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
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