From cb32f329da69d22a040c671b60c286f71b6d4541 Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Sun, 8 Sep 2024 10:43:58 -0400 Subject: [PATCH] update release workflows to support releases from non-main branches --- .github/workflows/_release.yml | 10 ++++++++-- .github/workflows/_test_release.yml | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index bf03d7e5..692bf982 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -13,6 +13,11 @@ 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" @@ -20,7 +25,7 @@ env: jobs: build: - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release runs-on: ubuntu-latest outputs: @@ -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: @@ -270,4 +276,4 @@ jobs: draft: false generateReleaseNotes: true tag: ${{ inputs.working-directory }}/v${{ needs.build.outputs.version }} - commit: main + commit: ${{ github.sha }} diff --git a/.github/workflows/_test_release.yml b/.github/workflows/_test_release.yml index 39be5ea1..11436869 100644 --- a/.github/workflows/_test_release.yml +++ b/.github/workflows/_test_release.yml @@ -7,6 +7,11 @@ 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" @@ -14,7 +19,7 @@ env: jobs: build: - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || inputs.dangerous-nonmaster-release runs-on: ubuntu-latest outputs: