Skip to content

Commit

Permalink
fix: publish to npm automation (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Feb 15, 2023
1 parent 0877abc commit f50715f
Show file tree
Hide file tree
Showing 5 changed files with 369 additions and 360 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/on-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Setup dependencies, cache and install
uses: ./.github/actions/install

- name: Publish to npm
run: yarn publish --access public --tag "latest-rc"
run: yarn publish --access public --tag "latest-rc" --new-version $(yarn --silent app:version)
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/on-published-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ on:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: apexskier/github-release-commenter@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
comment-template: |
Shipped in [release \`{release_tag}\`]({release_link}).
Shipped in [release \`{release_tag}\`]({release_link}).
You can install the new version using the version number or the \`latest-rc\` channel
\`\`\`sh
$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@{release_tag}
\`\`\`
2 changes: 1 addition & 1 deletion .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Lint PR
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}

npm-lint:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"homepage": "https://github.com/scolladon/sfdx-git-delta#readme",
"scripts": {
"analysis": "codeclimate analyze",
"app:version": "echo $npm_package_version",
"audit:fix": "npm i --package-lock-only && npm audit fix && rm yarn.lock && yarn import && rm package-lock.json",
"commit": "commit",
"lint": "eslint src/",
Expand Down Expand Up @@ -81,7 +82,7 @@
"eslint-plugin-jsdoc": "^40.0.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"jest": "^29.4.2",
"jest": "^29.4.3",
"lint-staged": "^13.1.2",
"nyc": "^15.1.0",
"prettier": "^2.8.4",
Expand Down
Loading

0 comments on commit f50715f

Please sign in to comment.