diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml new file mode 100644 index 0000000..fcaa866 --- /dev/null +++ b/.github/workflows/release-branch.yml @@ -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}" diff --git a/workflow-templates/release-branch.properties.json b/workflow-templates/release-branch.properties.json new file mode 100644 index 0000000..fef5538 --- /dev/null +++ b/workflow-templates/release-branch.properties.json @@ -0,0 +1,8 @@ +{ + "name": "Release Brancher", + "description": "Starter workflow for creating release branches", + "iconName": "octicon git-branch", + "categories": [ + "Automation" + ] +} diff --git a/workflow-templates/release-branch.yml b/workflow-templates/release-branch.yml new file mode 100644 index 0000000..e1bdd92 --- /dev/null +++ b/workflow-templates/release-branch.yml @@ -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: true + 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 }}