Skip to content

Commit

Permalink
Remove RC step and move all to Release workflow (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
njooma authored Jun 25, 2024
1 parent 7e6bfa9 commit 64150be
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 128 deletions.
113 changes: 0 additions & 113 deletions .github/workflows/release-candidate.yml

This file was deleted.

46 changes: 31 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,41 @@ name: Release

on:
workflow_dispatch:
inputs:
version:
description: "The type of version bump. Use `-s` for no change. See docs for details: https://python-poetry.org/docs/cli/#version"
type: choice
required: true
default: "-s"
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease
- prerelease --next-phase
- "-s"

jobs:
prepare:
if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-')
if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.bump_version.outputs.version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
cache: poetry

- name: Install Package
run: poetry install --all-extras
Expand All @@ -31,7 +48,7 @@ jobs:
id: bump_version
shell: bash
run: |
poetry version $(poetry version -s | sed -e 's/\"//g' -e 's/rc.*//g')
poetry version ${{ inputs.version }}
echo "SDK_VERSION=$(poetry version -s)" >> $GITHUB_ENV
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
Expand All @@ -52,26 +69,25 @@ jobs:
- name: Add + Commit
uses: EndBug/add-and-commit@v9
with:
new_branch: rc-${{ env.SDK_VERSION }}
new_branch: v${{ env.SDK_VERSION }}
message: Bump version to ${{ env.SDK_VERSION }}

- name: Open PR
uses: repo-sync/pull-request@v2
with:
destination_branch: "main"
pr_title: rc-${{ env.SDK_VERSION }}
pr_body: This is an auto-generated PR to merge the rc branch back into main upon successful release.
run: |
gh pr create -t "v${{ env.SDK_VERSION }}" -b "This is an auto-generated PR to merge the release branch back into main upon successful release" -B "main" -H "v${{ env.SDK_VERSION }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
uses: ./.github/workflows/build-wheels.yml
with:
branch: rc-${{ needs.prepare.outputs.version }}
branch: v${{ needs.prepare.outputs.version }}
needs: prepare
if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-')
if: github.repository_owner == 'viamrobotics'

release:
needs: [prepare, build]
if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-')
if: github.repository_owner == 'viamrobotics
runs-on: ubuntu-latest

steps:
Expand All @@ -87,4 +103,4 @@ jobs:
draft: true
prerelease: false
fail_on_unmatched_files: true
target_commitish: rc-${{ needs.prepare.outputs.version }}
target_commitish: v${{ needs.prepare.outputs.version }}

0 comments on commit 64150be

Please sign in to comment.