Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
duysolo committed Aug 5, 2022
1 parent 05bfd0b commit ac2a0c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ jobs:
permissions:
packages: write
contents: read
env:
NEW_PACKAGE_VERSION: ${{ github.event.release.tag_name }}
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
scope: '@mercury-labs'
run: |
echo "The NEW_PACKAGE_VERSION key is:${{env.NEW_PACKAGE_VERSION}}"
- run: npm ci
- run: npm run build
- run: npm run increase-version
- run: npm publish
env:
NEW_PACKAGE_VERSION: ${{ github.event.release.tag_name }}
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
4 changes: 4 additions & 0 deletions infrastructure/increase-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const packageContent = JSON.parse(raw)
packageContent.version =
process.env.NEW_PACKAGE_VERSION || packageContent.version

console.log({
newVersion: packageContent.version
})

fs.writeFileSync(
'./package.json',
JSON.stringify(packageContent, undefined, 2)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@
"publishConfig": {
"duysolo:registry": "https://npm.pkg.github.com"
}
}
}

0 comments on commit ac2a0c1

Please sign in to comment.