fix #640
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: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: | |
- '@acala-network/eth-transactions' | |
- '@acala-network/eth-providers' | |
- '@acala-network/eth-rpc-adapter' | |
- '@acala-network/bodhi' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: setup yarn | |
run: npm install -g yarn | |
- name: install deps | |
run: yarn install --immutable | |
- name: build | |
run: yarn build | |
- name: git config email | |
run: git config --local user.email bodhibot@users.noreply.github.com | |
- name: git config name | |
run: git config --local user.name Bodhibot | |
# Writes token to .yarnrc.yml. If written directly in .yarnrc.yml, it will cause an error | |
- run: | | |
echo npmAuthToken: "\${NPM_AUTH_TOKEN}" >> ./.yarnrc.yml | |
- name: publish ${{ matrix.package }} | |
run: | | |
# version containing a hyphen, publish as beta, i.e: 1.0.0-1 | |
if npm pkg get version --workspace ${{ matrix.package }} | jq '."${{ matrix.package }}"' | grep '-'; then TAG='--tag beta'; fi | |
yarn workspace ${{ matrix.package }} npm publish --tolerate-republish --access public $TAG | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- run: | | |
git checkout ./.yarnrc.yml |