Skip to content

Commit

Permalink
SHIP-0038: Release Branch Workflows
Browse files Browse the repository at this point in the history
Creating a reusable GitHub Actions workflow to set up release branches
in Shipwright projects, and a corresponding starter workflow template.
These workflows will let Shipwright projects opt into setting up
release branches for project artifacts. The workflows allow branches to
be created at specific git references, allowing release branches to be
set up retroactively.

Signed-off-by: Adam Kaplan <[email protected]>
  • Loading branch information
adambkaplan committed Mar 11, 2024
1 parent 91f680a commit fb4cc1c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Reusable release brancher workflow
# See SHIP-0038: https://github.com/shipwright-io/community/pull/194
name: Release Brancher
on:
workflow_call:
inputs:
release-version:
required: true
type: string
git-ref:
required: false
type: string
jobs:
release-brancher:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.git-ref }}
- name: Create release branch
env:
RELEASE_VERSION: release-${{ inputs.release-version }}
run: |
git switch -c "${RELEASE_VERSION}"
git push --set-upstream origin "${RELEASE_VERSION}"
8 changes: 8 additions & 0 deletions workflow-templates/release-branch.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "adambkaplan Release Brancher",
"description": "Starter workflow for creating release branches",
"iconName": "octicon git-branch",
"categories": [
"Automation"
]
}
23 changes: 23 additions & 0 deletions workflow-templates/release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Release branch starter workflow
# See SHIP-0038: https://github.com/shipwright-io/community/pull/194
name: Create Release Branch
on:
workflow_dispatch:
inputs:
release-version:
required: true
type: string
description: "Semantic version for the release branch (vX.Y format)"
git-ref:
required: false
type: string
description: "Git ref to create the release branch from (defaults to main)"
default: "main"
jobs:
create-release-branch:
permissions:
contents: write
uses: shipwright-io/.github/.github/workflows/release-branch.yml@main
with:
release-version: ${{ inputs.release-version }}
git-ref: ${{ inputs.git-ref }}

0 comments on commit fb4cc1c

Please sign in to comment.