Release #3
Workflow file for this run
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "The type of version bump." | |
type: choice | |
required: true | |
default: nobump | |
options: | |
- major | |
- minor | |
- patch | |
- nobump | |
jobs: | |
prepare: | |
if: github.repository_owner == 'viamrobotics' | |
environment: release | |
runs-on: [self-hosted, x64] | |
container: | |
image: ghcr.io/cirruslabs/flutter:3.10.6 | |
outputs: | |
version: ${{ steps.which_version.outputs.version }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- run: git config --global --add safe.directory /__w/viam-flutter-sdk/viam-flutter-sdk | |
- name: Setup Flutter | |
run: flutter pub get | |
- run: make setup | |
- name: Format + Test | |
run: make format test | |
- name: Bump Version | |
if: inputs.version != 'nobump' | |
shell: bash | |
run: $HOME/.pub-cache/bin/cider bump ${{ inputs.version }} | |
- name: Which Version | |
id: which_version | |
shell: bash | |
run: echo "version=$($HOME/.pub-cache/bin/cider version)" >> $GITHUB_OUTPUT | |
- name: Check if release exists | |
uses: cardinalby/git-get-release-action@1.2.4 | |
id: release_exists | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
releaseName: v${{ steps.which_version.outputs.version }} | |
doNotFailIfNotFound: "true" | |
- name: Cancelling - release already exists | |
uses: andymckay/cancel-action@0.2 | |
if: steps.release_exists.outputs.id != '' | |
- name: Add + Commit | |
uses: EndBug/add-and-commit@v9 | |
with: | |
new_branch: v${{ steps.which_version.outputs.version }} | |
message: Bump version to ${{ steps.which_version.outputs.version }} | |
- name: Open PR | |
uses: repo-sync/pull-request@v2 | |
with: | |
destination_branch: "main" | |
pr_title: ${{ steps.which_version.outputs.version }} | |
pr_body: This is an auto-generated PR to merge the rc branch back into main upon successful release. | |
release: | |
needs: [prepare] | |
if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-') | |
runs-on: [self-hosted, x64] | |
container: | |
image: ghcr.io/viamrobotics/canon:amd64 | |
steps: | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ needs.prepare.outputs.version }} | |
draft: true | |
prerelease: false | |
target_commitish: rc-${{ needs.prepare.outputs.version }} |