-
Notifications
You must be signed in to change notification settings - Fork 19
41 lines (38 loc) · 1.34 KB
/
cli.build+publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "cli: build+publish"
on:
push:
branches-ignore:
- "master"
paths:
- "packages/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.16"
registry-url: "https://registry.npmjs.org"
scope: "@bisonai"
always-auth: true
- name: Install dependencies
run: yarn workspace @bisonai/orakl-cli install
- name: Run lint
run: yarn workspace @bisonai/orakl-cli lint --fix
- name: Build package
run: yarn workspace @bisonai/orakl-cli build
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: packageJsonVersion
with:
cmd: "jq .version ./packages/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 workspace @bisonai/orakl-cli publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}