add github workflows #1
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 and Publish RC | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | ||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yml | ||
appimage: | ||
uses: ./.github/workflows/appimage.yml | ||
needs: test | ||
with: | ||
release_type: 'rc' | ||
secrets: | ||
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
name: Build and Publish Stable | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
# To test workflow updates you need to work in a branch directly on viamrobotics/viam-cartographer | ||
# and tag your working branch instead of @main in any viamrobotics/viam-cartographer "uses" below. | ||
# Don't forget to tag back to @main before merge. | ||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yml | ||
appimage: | ||
# remove | ||
uses: ./.github/workflows/appimage.yml | ||
needs: test | ||
with: | ||
release_type: 'stable' | ||
secrets: | ||
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
slack-workflow-status: | ||
if: ${{ failure() }} | ||
name: Post Workflow Status To Slack | ||
needs: | ||
- test | ||
- appimage | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: 'read' | ||
steps: | ||
- name: Slack Workflow Notification | ||
uses: Gamesight/slack-workflow-status@master | ||
with: | ||
repo_token: ${{secrets.GITHUB_TOKEN}} | ||
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} | ||
channel: '#bucket-canary' | ||
name: 'Workflow Status' | ||
name: Deploy Bosch BME280 Module to Registry | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
env: | ||
VERSION: ${{ github.ref_name }} | ||
jobs: | ||
appimage: | ||
name: AppImage Build and Upload Cartographer to Registry | ||
strategy: | ||
fail-fast: false | ||
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 linux/${{ matrix.platform }} | ||
timeout-minutes: 45 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
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' | ||
- name: Build appimage | ||
run: | | ||
sudo -u testbot bash -lc 'make BUILD_CHANNEL="${{ github.ref_name }}" appimage' | ||
- name: Bundle module | ||
run: | | ||
cp etc/packaging/appimages/deploy/cartographer-module-*.AppImage cartographer-module.AppImage | ||
tar czf module.tar.gz cartographer-module.AppImage | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: appimage-${{ matrix.platform }} | ||
path: module.tar.gz | ||
upload: | ||
needs: appimage | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [amd64, arm64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: appimage-${{ matrix.platform }} | ||
- id: stripped-version | ||
run: echo version=${VERSION#v} >> $GITHUB_OUTPUT | ||
- uses: viamrobotics/upload-module@main | ||
if: github.event_name == 'release' && !contains(github.ref_name, 'rc') | ||
with: | ||
platform: linux/${{ matrix.platform }} | ||
version: ${{ steps.stripped-version.outputs.version }} | ||
key-id: ${{ secrets.VIAM_DEV_API_KEY_ID }} | ||
key-value: ${{ secrets.VIAM_DEV_API_KEY }} |