Build AppImage Cartographer #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build AppImage Cartographer | |
on: | |
workflow_dispatch: | |
inputs: | |
release_type: | |
required: true | |
type: string | |
workflow_call: | |
inputs: | |
release_type: | |
required: true | |
type: string | |
secrets: | |
GCP_WORKLOAD_IDENTITY_PROVIDER: | |
required: true | |
GCP_SERVICE_ACCOUNT: | |
required: true | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
appimage: | |
name: AppImage Build Cartographer | |
strategy: | |
matrix: | |
include: | |
- arch: buildjet-8vcpu-ubuntu-2204 | |
image: ghcr.io/viamrobotics/rdk-devenv:amd64-cache | |
platform: amd64 | |
- arch: buildjet-8vcpu-ubuntu-2204-arm | |
image: ghcr.io/viamrobotics/rdk-devenv:arm64-cache | |
platform: arm64 | |
runs-on: ${{ matrix.arch }} | |
container: | |
image: ${{ matrix.image }} | |
options: --platform ${{ matrix.platform }} | |
timeout-minutes: 45 | |
steps: | |
- name: Check out code | |
if: inputs.release_type != 'pr' | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Check out PR branch code | |
if: inputs.release_type == 'pr' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: apt update | |
run: | | |
sudo apt update | |
- name: Clean and Fix Permissions | |
run: | | |
chown -R testbot:testbot . | |
sudo -u testbot bash -lc 'make clean' | |
- name: make setup | |
run: | | |
sudo -u testbot bash -lc 'make setup' | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
create_credentials_file: true | |
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
- name: Build and Package (PR) | |
if: inputs.release_type == 'pr' | |
run: | | |
sudo -u testbot bash -lc 'make BUILD_CHANNEL="pr-${{ github.event.pull_request.number }}" appimage' | |
- name: Build and Package (Latest) | |
if: inputs.release_type == 'latest' | |
run: | | |
apt-get -y install swig | |
sudo -Hu testbot bash -lc 'make BUILD_CHANNEL="latest" appimage' | |
- name: Build and Package (Tagged) | |
if: inputs.release_type == 'stable' || inputs.release_type == 'rc' | |
run: | | |
apt-get -y install swig | |
sudo -Hu testbot bash -lc 'make RELEASE_TYPE="${{ inputs.release_type }}" BUILD_CHANNEL="${{ github.ref_name }}" appimage' | |
- name: Deploy Files | |
uses: google-github-actions/[email protected] | |
with: | |
headers: "cache-control: no-cache" | |
path: 'etc/packaging/appimages/deploy/' | |
destination: 'packages.viam.com/apps/slam-servers/' | |
glob: '*' | |
parent: false | |
gzip: false |