-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (83 loc) · 2.93 KB
/
main.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build Latest
on:
push:
branches:
- '*'
paths-ignore:
- 'README.md'
- 'docs/**'
jobs:
appimage:
name: Build/Test/Upload latest
runs-on: buildjet-2vcpu-ubuntu-2204-arm
strategy:
matrix:
include:
- container: ghcr.io/seanavery/viam-cpp-base-jetson:0.0.3
TARGET: jetson
META_PATH: meta.json
- container: ghcr.io/seanavery/viam-cpp-base-pi:0.0.3
TARGET: pi
META_PATH: meta-pi.json
container:
image: ${{ matrix.container }}
options: --platform linux/arm64
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set environment variables
run: |
echo "TARGET=${{ matrix.TARGET }}" >> $GITHUB_ENV
echo "META_PATH=${{ matrix.META_PATH }}" >> $GITHUB_ENV
- name: Clean build artifacts
run: make clean
- name: Install module dependencies
run: make dep
- name: Build viam-csi binary
run: make build
- name: Build viam-csi appimage
run: make package
- name: Copy binary and appimage to bin folder
run: make bin
- name: Run appimage in fresh instance
run: |
make image-test
make test-package
- name: Authorize GCP upload
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Deploy Files
uses: google-github-actions/[email protected]
with:
headers: "cache-control: no-cache"
path: 'bin'
destination: 'packages.viam.com/apps/csi-camera/${{ env.TARGET }}'
glob: '*aarch64*'
parent: false
gzip: false
- name: Get latest release version
id: get_version
run: |
apt install -y jq
LATEST_RELEASE=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "LATEST_RELEASE_VERSION=$LATEST_RELEASE" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Testing module env variables
run: |
echo "TARGET=${{ env.TARGET }}"
echo "META_PATH=${{ env.META_PATH }}"
echo "COMMIT_COUNT=${{ env.COMMIT_COUNT }}"
echo "LATEST_RELEASE_VERSION=${{ env.LATEST_RELEASE_VERSION }}"
echo "version: ${{ env.LATEST_RELEASE_VERSION }}-${{ github.ref_name }}.${{ github.run_number }}"
- name: Update module registry
uses: viamrobotics/upload-module@main
if: github.event_name == 'push'
with:
meta-path: ${{ env.META_PATH }}
module-path: bin/viam-csi-latest-aarch64.AppImage
platform: linux/arm64
version: ${{ env.LATEST_RELEASE_VERSION }}-${{ github.ref_name }}.${{ github.run_number }}
key-id: ${{ secrets.viam_key_id }}
key-value: ${{ secrets.viam_key_value }}