Skip to content

Commit

Permalink
RSDK-2996 Release Candidate Workflows (#2336)
Browse files Browse the repository at this point in the history
  • Loading branch information
Otterverse authored and edaniels committed May 11, 2023
1 parent 1440884 commit 4a72a14
Show file tree
Hide file tree
Showing 16 changed files with 239 additions and 100 deletions.
56 changes: 49 additions & 7 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Build AppImage
on:
workflow_dispatch:
workflow_call:
inputs:
release_type:
required: true
type: string
secrets:
GCP_CREDENTIALS:
required: true
Expand All @@ -25,10 +29,10 @@ jobs:
options: --platform ${{ matrix.platform }}
timeout-minutes: 15
outputs:
date: ${{ steps.build_test_app.outputs.date }}
date: ${{ steps.build_date.outputs.date }}

steps:
- name: Check out main branch code
- name: Check out code
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -68,23 +72,44 @@ jobs:
gzip: false

- name: Build and Package (Latest)
id: build_test_app
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
if: inputs.release_type == 'latest'
run: |
echo "date=`date +%F`" >> $GITHUB_OUTPUT
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: |
sudo -Hu testbot bash -lc 'make RELEASE_TYPE="${{ inputs.release_type }}" BUILD_CHANNEL="${{ github.ref_name }}" appimage'
- name: Set Date
id: build_date
run: echo "date=`date +%F`" >> $GITHUB_OUTPUT

- name: Upload Files (Testing)
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
uses: google-github-actions/[email protected]
with:
headers: "cache-control: no-cache"
path: 'etc/packaging/appimages/deploy/'
destination: 'packages.viam.com/apps/viam-server/testing/appimage/${{ steps.build_test_app.outputs.date }}/${{ github.sha }}/'
destination: 'packages.viam.com/apps/viam-server/testing/appimage/${{ steps.build_date.outputs.date }}/${{ github.sha }}/'
glob: '*'
parent: false
gzip: false

output_summary:
name: Output Summary
runs-on: ubuntu-latest
needs: appimage
if: contains(github.event.pull_request.labels.*.name, 'appimage') || contains(github.event.pull_request.labels.*.name, 'appimage-ignore-tests')
steps:
- name: Display Download Links
run: |
channel="pr-${{ github.event.pull_request.number }}"
echo "### Built AppImages for ${channel}" >> $GITHUB_STEP_SUMMARY
echo "- arm64: https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-${channel}-aarch64.AppImage" >> $GITHUB_STEP_SUMMARY
echo "- x86_64: https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-${channel}-x86_64.AppImage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
appimage_test:
name: AppImage Test
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
Expand All @@ -106,10 +131,15 @@ jobs:
- name: Test AppImage
run: |
channel="${{ github.ref_name }}"
# we call our main branch releases "latest"
if [ "$channel" = "main" ]; then
channel="latest"
fi
export TEST_DIR=`mktemp -d -t test-viam-server-XXXXXX`
cd $TEST_DIR
curl -o viam-server https://storage.googleapis.com/packages.viam.com/apps/viam-server/testing/appimage/${{ needs.appimage.outputs.date }}/${{ github.sha }}/viam-server-latest-`uname -m`.AppImage
curl -o viam-server https://storage.googleapis.com/packages.viam.com/apps/viam-server/testing/appimage/${{ needs.appimage.outputs.date }}/${{ github.sha }}/viam-server-${channel}-`uname -m`.AppImage
chmod 755 viam-server
export RAND_PORT=$((30000 + $RANDOM))
Expand Down Expand Up @@ -141,3 +171,15 @@ jobs:
- name: Publish AppImage
run: |
gsutil mv "gs://packages.viam.com/apps/viam-server/testing/appimage/${{ needs.appimage_test.outputs.date }}/${{ github.sha }}/*" "gs://packages.viam.com/apps/viam-server/"
- name: Output Summary
run: |
channel="${{ github.ref_name }}"
# we call our main branch releases "latest"
if [ "$channel" == "main" ]; then
channel="latest"
fi
echo "### Built AppImages for ${channel}" >> $GITHUB_STEP_SUMMARY
echo "- arm64: https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-${channel}-aarch64.AppImage" >> $GITHUB_STEP_SUMMARY
echo "- x86_64: https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-${channel}-x86_64.AppImage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
22 changes: 12 additions & 10 deletions .github/workflows/license_finder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: License Finder
on:
workflow_dispatch:
workflow_call:
pull_request:
branches: [ main ]
push:

jobs:
license_finder:
Expand All @@ -17,11 +14,16 @@ jobs:
timeout-minutes: 30

steps:
- name: Check out code in rdk directory
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check out code
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v3

- name: Run license finder
run: |
sudo -Hu testbot bash -lc 'make license-check'
- 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 }}

- name: Run license finder
run: |
sudo -Hu testbot bash -lc 'make license-check'
12 changes: 9 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Main Branch Update
name: Build and Publish Latest

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -9,8 +9,6 @@ on:
branches: [ main ]
paths-ignore:
- 'README.md'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

# To test workflow updates you need to work in a branch directly on viamrobotics/rdk
# and tag your working branch instead of @main in any viamrobotics/rdk "uses" below.
Expand All @@ -25,12 +23,16 @@ jobs:
appimage:
needs: test
uses: viamrobotics/rdk/.github/workflows/appimage.yml@main
with:
release_type: 'latest'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

staticbuild:
needs: test
uses: viamrobotics/rdk/.github/workflows/staticbuild.yml@main
with:
release_type: 'latest'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

Expand All @@ -40,12 +42,16 @@ jobs:
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

license_finder:
uses: viamrobotics/rdk/.github/workflows/license_finder.yml@main

slack-workflow-status:
if: ${{ failure() }}
name: Post Workflow Status To Slack
needs:
- test
- appimage
- staticbuild
runs-on: ubuntu-latest
permissions:
actions: 'read'
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pullrequest-trusted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
!contains(github.event.pull_request.labels.*.name, 'appimage-ignore-tests') &&
contains(github.event.pull_request.labels.*.name, 'appimage') && needs.test.result == 'success'
uses: viamrobotics/rdk/.github/workflows/appimage.yml@main
with:
release_type: 'pr'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

Expand All @@ -36,6 +38,8 @@ jobs:
always() && !cancelled() && contains(github.event.pull_request.labels.*.name, 'safe to test') &&
contains(github.event.pull_request.labels.*.name, 'appimage-ignore-tests')
uses: viamrobotics/rdk/.github/workflows/appimage.yml@main
with:
release_type: 'pr'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

Expand All @@ -47,6 +51,8 @@ jobs:
!contains(github.event.pull_request.labels.*.name, 'static-ignore-tests') &&
contains(github.event.pull_request.labels.*.name, 'static-build') && needs.test.result == 'success'
uses: viamrobotics/rdk/.github/workflows/staticbuild.yml@main
with:
release_type: 'pr'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

Expand All @@ -55,5 +61,10 @@ jobs:
always() && !cancelled() && contains(github.event.pull_request.labels.*.name, 'safe to test') &&
contains(github.event.pull_request.labels.*.name, 'static-ignore-tests')
uses: viamrobotics/rdk/.github/workflows/staticbuild.yml@main
with:
release_type: 'pr'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

license_finder:
uses: viamrobotics/rdk/.github/workflows/license_finder.yml@main
35 changes: 35 additions & 0 deletions .github/workflows/releasecandidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Publish RC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'

# To test workflow updates you need to work in a branch directly on viamrobotics/rdk
# and tag your working branch instead of @main in any viamrobotics/rdk "uses" below.
# Don't forget to tag back to @main before merge.

jobs:
test:
uses: viamrobotics/rdk/.github/workflows/test.yml@main
secrets:
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}

appimage:
needs: test
uses: viamrobotics/rdk/.github/workflows/appimage.yml@main
with:
release_type: 'rc'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

staticbuild:
needs: test
uses: viamrobotics/rdk/.github/workflows/staticbuild.yml@main
with:
release_type: 'rc'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
54 changes: 54 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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/rdk
# and tag your working branch instead of @main in any viamrobotics/rdk "uses" below.
# Don't forget to tag back to @main before merge.

jobs:
test:
uses: viamrobotics/rdk/.github/workflows/test.yml@main
secrets:
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}

appimage:
needs: test
uses: viamrobotics/rdk/.github/workflows/appimage.yml@main
with:
release_type: 'stable'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

staticbuild:
needs: test
uses: viamrobotics/rdk/.github/workflows/staticbuild.yml@main
with:
release_type: 'stable'
secrets:
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}

slack-workflow-status:
if: ${{ failure() }}
name: Post Workflow Status To Slack
needs:
- test
- appimage
- staticbuild
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: '#team-devops'
name: 'Workflow Status'
Loading

0 comments on commit 4a72a14

Please sign in to comment.