forked from viamrobotics/rdk
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (62 loc) · 1.84 KB
/
cli.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
name: Viam CLI
on:
workflow_dispatch:
inputs:
release_type:
required: true
type: string
default: latest
workflow_call:
inputs:
release_type:
required: true
type: string
secrets:
GCP_CREDENTIALS:
required: true
jobs:
viam-cli:
runs-on: ubuntu-latest
steps:
- name: Check out code
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
uses: actions/checkout@v3
- name: Check out PR branch code
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: build
env:
CI_RELEASE: ${{ inputs.release_type }}
run: |
GOOS=linux GOARCH=amd64 make cli-ci
GOOS=linux GOARCH=arm64 make cli-ci
GOOS=darwin GOARCH=amd64 make cli-ci
GOOS=darwin GOARCH=arm64 make cli-ci
GOOS=windows GOARCH=amd64 EXE_SUFFIX=.exe make cli-ci
- name: tagged alias
env:
CI_RELEASE: ${{ github.ref_name }}
if: inputs.release_type == 'stable'
run: |
GOOS=linux GOARCH=amd64 make cli-ci
GOOS=linux GOARCH=arm64 make cli-ci
GOOS=darwin GOARCH=amd64 make cli-ci
GOOS=darwin GOARCH=arm64 make cli-ci
GOOS=windows GOARCH=amd64 EXE_SUFFIX=.exe make cli-ci
- name: Authorize GCP Upload
uses: google-github-actions/[email protected]
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: upload
uses: google-github-actions/[email protected]
with:
headers: "cache-control: no-cache"
path: 'bin/deploy-ci'
glob: 'viam-cli-*'
destination: 'packages.viam.com/apps/viam-cli/'
parent: false