Skip to content

Commit

Permalink
fix: github npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
jgazeau committed Aug 6, 2022
1 parent 94b7d83 commit a9cfef7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
- '**'
paths:
- '**'
- '!CHANGELOG.md'
env:
NPM_CACHE_NAME: "npm-cache"
NPM_CACHE_PATH: "~/.npm"
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,36 @@ jobs:
Publish:
name: Publish
runs-on: ubuntu-latest
env:
CHANGELOG_FILE: CHANGELOG.md
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: 'main'
submodules: recursive
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Generate changelog
env:
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=${GITHUB_REF##*/}
printf "%70s\n" | tr ' ' '-'
npm ci
printf "%70s\n" | tr ' ' '-'
npm version ${TAG_NAME} --no-git-tag-version
printf "%70s\n" | tr ' ' '-'
git add package.json
git add package-lock.json
printf "%70s\n" | tr ' ' '-'
git config --local user.name "GitHub Action"
git config --local user.email "action@github.com"
git commit -m "tag/${TAG_NAME}"
git tag ${TAG_NAME}
git push
git push -f origin ${TAG_NAME}
- name: Publish on Npm
uses: JS-DevTools/npm-publish@v1
with:
Expand Down

0 comments on commit a9cfef7

Please sign in to comment.