-
-
Notifications
You must be signed in to change notification settings - Fork 15
83 lines (75 loc) · 2.71 KB
/
build.yml
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
78
79
80
81
82
83
name: build
on: [push]
jobs:
test_build:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Install QEMU for cross compilation
id: QEMU
uses: docker/setup-qemu-action@v1
# check compilation aginst different node versions in arm platforms
- run: echo "Testing Arm lts builds..."
- run: ./docker_build.sh build "arm32v7/node:12-bullseye"
- run: ./docker_build.sh build "arm32v7/node:14-bullseye"
- run: ./docker_build.sh build "arm32v7/node:16-bullseye"
- run: ./docker_build.sh build "arm32v7/node:18-bullseye"
- run: ./docker_build.sh build "arm64v8/node:12-bullseye"
- run: ./docker_build.sh build "arm64v8/node:14-bullseye"
- run: ./docker_build.sh build "arm64v8/node:16-bullseye"
- run: ./docker_build.sh build "arm64v8/node:18-bullseye"
- run: ./docker_build.sh build "arm64v8/node:current-bullseye"
build:
runs-on: ubuntu-latest
needs: test_build
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Set up node for packing
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install QEMU for cross compilation
id: QEMU
uses: docker/setup-qemu-action@v1
# Prebuild phase
- run: ./docker_build.sh prebuild
# Create the package
- name: build package
run: |
npm pack
echo "##[set-output name=version;]$(npm run package-version --silent)"
id: pack
- name: save tarball
uses: actions/upload-artifact@v2
with:
name: ${{ format('nrf24-{0}.tgz', steps.pack.outputs.version) }}
path: ${{ format('nrf24-{0}.tgz', steps.pack.outputs.version) }}
# NPM publish job
publish:
#if: todo tag
runs-on: ubuntu-latest
needs: build
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Set up node for publishing
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Get Version
run: echo "##[set-output name=version;]$(npm run package-version --silent)"
id: version
- name: Get tarball
uses: actions/download-artifact@v2
with:
name: ${{ format('nrf24-{0}.tgz', steps.version.outputs.version) }}
#path: ${{ format('nrf24-{0}.tgz', steps.version.outputs.version) }}
- name: publish npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish ${TARBALL} --access public --dry-run
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TARBALL: ${{ format('nrf24-{0}.tgz', steps.version.outputs.version) }}