Audit (#15) #3
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 npm dev packages | |
on: | |
push: | |
branches: [master] | |
jobs: | |
test: | |
uses: ./.github/workflows/build-lint-test.yml | |
publish-npm: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
registry-url: https://registry.npmjs.org | |
cache: 'yarn' | |
- run: yarn --immutable --immutable-cache | |
- name: Restore snap build cache | |
uses: actions/cache@v3 | |
with: | |
path: ./packages/snap/dist | |
key: snap-${{ runner.os }}-${{ github.sha }} | |
- run: yarn build | |
- name: Publish dev package on npm | |
working-directory: packages/snap | |
run: | | |
npm version --preid dev --no-git-tag-version --no-commit-hooks --force prepatch | |
TIME=$(date -u +%Y%m%d%H%M%S) sed -i "/version/s/dev.0/dev.$TIME/g" packages/*/package.json | |
npm publish --access public --tag dev | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} |