-
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.
- Loading branch information
1 parent
88ced9c
commit 934d524
Showing
1 changed file
with
13 additions
and
7 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: NPM Package | |
on: | ||
push: | ||
branches: | ||
- main # Replace with your default branch name if it's different | ||
- main | ||
release: | ||
types: [created] | ||
|
||
|
@@ -18,6 +18,7 @@ jobs: | |
- run: npm ci | ||
- run: npm run lint | ||
- run: npm test | ||
- run: npm run build | ||
|
||
version: | ||
runs-on: ubuntu-latest | ||
|
@@ -33,12 +34,10 @@ jobs: | |
git config --global user.email "[email protected]" | ||
git config --global user.name "Ruan Luies" | ||
- run: npm run release | ||
- name: Set Git user | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Ruan Luies" | ||
- name: Push changes and tags | ||
- name: Commit and push changes | ||
run: | | ||
git add . | ||
git commit -m "chore(release): release new version" | ||
git push --follow-tags origin main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -53,7 +52,14 @@ jobs: | |
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm publish | ||
- run: npm run build | ||
- run: npm pack | ||
- name: Extract tarball and publish | ||
run: | | ||
mkdir -p publish | ||
tar -xvf *.tgz -C publish --strip-components 1 | ||
cd publish | ||
npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
|