Merge branch 'master' into i-843/fix/get-latest-submitted-value-for-a… #126
Workflow file for this run
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: "cli: build+publish" | |
on: | |
push: | |
branches-ignore: | |
- "master" | |
paths: | |
- "cli/**" | |
jobs: | |
build-publish: | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.12" | |
registry-url: "https://registry.npmjs.org" | |
scope: "@bisonai" | |
always-auth: true | |
- name: Install dependencies | |
run: yarn --cwd . install | |
working-directory: ./cli | |
- name: Run lint | |
run: yarn --cwd . lint | |
working-directory: ./cli | |
- name: Build package | |
run: yarn --cwd . build | |
working-directory: ./cli | |
- name: Extract version from package.json | |
uses: sergeysova/jq-action@v2 | |
id: packageJsonVersion | |
with: | |
cmd: "jq .version ./cli/package.json -r" | |
- name: Extract version from the latest published package | |
id: npmPackageVersion | |
run: echo "VERSION=`npm view @bisonai/orakl-cli version`" >> $GITHUB_OUTPUT | |
- name: Publish package | |
if: steps.packageJsonVersion.outputs.value != steps.npmPackageVersion.outputs.VERSION | |
run: yarn publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public | |
working-directory: ./cli | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |