v0.15.12 #41
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
name: Publish | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
npm: | |
name: NPM | |
runs-on: ubuntu-latest | |
environment: NPM Release | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
id: version | |
with: | |
script: | | |
const semver = context.ref.replace('refs/tags/v', '') | |
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) { | |
return semver | |
} | |
throw new Error('not semver') | |
result-encoding: string | |
- run: npm ci | |
- run: npm run build | |
- run: npm run version:set ${{ steps.version.outputs.result }} | |
# Because lerna doesn't update peers deps, although using it "wrongly" this behavior ensures all deps are aligned. | |
- name: find and replace peerDependencies | |
run: | | |
find packages/*/package.json adapters/package.json -type f -exec sed -i 's# "@defichain/salmon-core": "0.0.0"# "@defichain/salmon-core": "^${{ steps.version.outputs.result }}"#g' {} \; | |
- name: Publish | |
run: | | |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN | |
npm run publish:latest | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |