Skip to content

Commit

Permalink
Merge pull request #105 from DuendeSoftware/ev/build-release-from-tar…
Browse files Browse the repository at this point in the history
…get-branch

Build - Add capability to release from target branch
  • Loading branch information
Erwinvandervalk committed Feb 17, 2025
1 parent bf4c07b commit 577a509
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
8 changes: 7 additions & 1 deletion .github/workflow-gen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ void GenerateReleaseWorkflow(Component component)

workflow.On
.WorkflowDispatch()
.Inputs(new StringInput("version", "Version in format X.Y.Z or X.Y.Z-preview.", true, "0.0.0"));
.Inputs(new StringInput("version", "Version in format X.Y.Z or X.Y.Z-preview.", true, "0.0.0"))
.Inputs(new StringInput("target-branch", "(Optional) the name of the branch to release from", false, "main"));

workflow.EnvDefaults();

Expand All @@ -122,6 +123,11 @@ void GenerateReleaseWorkflow(Component component)
tagJob.Step()
.ActionsCheckout();

tagJob.Step()
.Name("Checkout target branch")
.If("github.event.inputs.branch != 'main'")
.Run("git checkout ${{ github.event.inputs.branch }}");

tagJob.StepSetupDotNet();

tagJob.Step()
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/access-token-management-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name: access-token-management/release
on:
workflow_dispatch:
inputs:
version:
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
target-branch:
description: '(Optional) the name of the branch to release from'
type: string
required: true
default: '0.0.0'
required: false
default: 'main'
env:
DOTNETT_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Expand All @@ -28,6 +28,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout target branch
if: github.event.inputs.branch != 'main'
run: git checkout ${{ github.event.inputs.branch }}
- name: Setup Dotnet
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/identity-model-oidc-client-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name: identity-model-oidc-client/release
on:
workflow_dispatch:
inputs:
version:
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
target-branch:
description: '(Optional) the name of the branch to release from'
type: string
required: true
default: '0.0.0'
required: false
default: 'main'
env:
DOTNETT_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Expand All @@ -28,6 +28,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout target branch
if: github.event.inputs.branch != 'main'
run: git checkout ${{ github.event.inputs.branch }}
- name: Setup Dotnet
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/identity-model-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name: identity-model/release
on:
workflow_dispatch:
inputs:
version:
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
target-branch:
description: '(Optional) the name of the branch to release from'
type: string
required: true
default: '0.0.0'
required: false
default: 'main'
env:
DOTNETT_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Expand All @@ -28,6 +28,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout target branch
if: github.event.inputs.branch != 'main'
run: git checkout ${{ github.event.inputs.branch }}
- name: Setup Dotnet
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ignore-this-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name: ignore-this/release
on:
workflow_dispatch:
inputs:
version:
description: 'Version in format X.Y.Z or X.Y.Z-preview.'
target-branch:
description: '(Optional) the name of the branch to release from'
type: string
required: true
default: '0.0.0'
required: false
default: 'main'
env:
DOTNETT_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Expand All @@ -28,6 +28,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout target branch
if: github.event.inputs.branch != 'main'
run: git checkout ${{ github.event.inputs.branch }}
- name: Setup Dotnet
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25
with:
Expand Down

0 comments on commit 577a509

Please sign in to comment.