Skip to content

Commit

Permalink
update release workflows to support releases from non-main branches
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Sep 8, 2024
1 parent 8958221 commit cb32f32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ on:
required: true
type: string
default: 'libs/vertexai'
dangerous-nonmaster-release:
required: false
type: boolean
default: false
description: "Release from a non-master branch (danger!)"

env:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.7.1"

jobs:
build:
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release
runs-on: ubuntu-latest

outputs:
Expand Down Expand Up @@ -75,6 +80,7 @@ jobs:
permissions: write-all
with:
working-directory: ${{ inputs.working-directory }}
dangerous-nonmaster-release: ${{ inputs.dangerous-nonmaster-release }}
secrets: inherit

pre-release-checks:
Expand Down Expand Up @@ -270,4 +276,4 @@ jobs:
draft: false
generateReleaseNotes: true
tag: ${{ inputs.working-directory }}/v${{ needs.build.outputs.version }}
commit: main
commit: ${{ github.sha }}
7 changes: 6 additions & 1 deletion .github/workflows/_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ on:
required: true
type: string
description: "From which folder this pipeline executes"
dangerous-nonmaster-release:
required: false
type: boolean
default: false
description: "Release from a non-master branch (danger!)"

env:
POETRY_VERSION: "1.7.1"
PYTHON_VERSION: "3.10"

jobs:
build:
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release
runs-on: ubuntu-latest

outputs:
Expand Down

0 comments on commit cb32f32

Please sign in to comment.