-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (73 loc) · 2.1 KB
/
ci.yml
File metadata and controls
77 lines (73 loc) · 2.1 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
jobs:
build_all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: "Install Dependencies"
run: |
sudo apt-get update && sudo apt-get install build-essential git libusb-1.0-0 libusb-1.0-0-dev libudev-dev
- name: "Build and lint deploy scripts"
run: |
cd core
npm i
npm run build
cd ../relay
npm i
npm run build
cd ../baker-endpoint
npm i
npm run build
cd ../flywheel
npm i
npm run build
publish_to_npm:
runs-on: ubuntu-latest
needs: [build_all]
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Get Release Version
id: get_release_version
run: echo "::set-output name=RELEASE_VERSION::${GITHUB_REF/refs\/tags\//}"
- run: |
set -x
RELEASE_VERSION=$(echo ${{ steps.get_release_version.outputs.RELEASE_VERSION }} | sed -e s/v//)
cd core
npm i
npm version $RELEASE_VERSION
npm run build
npm publish --access public
cd ../relay
npm i
npm install @flashbake/core@${RELEASE_VERSION}
npm version $RELEASE_VERSION
npm run build
npm publish --access public
cd ../baker-endpoint
npm i
npm install @flashbake/core@${RELEASE_VERSION}
npm version $RELEASE_VERSION
npm run build
npm publish --access public
cd ../flywheel
npm i
npm install @flashbake/core@${RELEASE_VERSION}
npm version $RELEASE_VERSION
npm run build
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}