Automated Release: Create next release branch #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Automated Release: Create next release branch" | |
on: | |
release: | |
types: [released] | |
workflow_dispatch: | |
jobs: | |
get-master-sha: | |
name: Get master sha | |
runs-on: ubuntu-latest | |
outputs: | |
sha: ${{ steps.get_sha.outputs.sha }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Get default branch sha | |
id: get_sha | |
run: | | |
BASE_SHA=$(git rev-parse master) | |
echo "sha=$BASE_SHA" >> $GITHUB_OUTPUT | |
echo "Release branch will be cut from master at $BASE_SHA" | |
calculate-next-version: | |
needs: get-master-sha | |
uses: ./.github/workflows/automated_release.calculate_next_version.yml | |
with: | |
regex: ^v\d+\.\d+\.\d+$ | |
from_branch: ${{ needs.get-master-sha.outputs.sha }} | |
create-next-release-branch: | |
needs: [calculate-next-version, get-master-sha] | |
runs-on: ubuntu-latest | |
environment: TestPypi # For the branch restrictions token | |
permissions: | |
contents: write | |
outputs: | |
new_branch: ${{ needs.calculate-next-version.outputs.version }} | |
steps: | |
- name: Create branch ${{ needs.calculate-next-version.outputs.version }} from ${{ needs.get-master-sha.outputs.sha }} | |
uses: peterjgrainger/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.TAGGING_TOKEN }} | |
with: | |
branch: ${{ needs.calculate-next-version.outputs.version }} | |
sha: ${{ needs.get-master-sha.outputs.sha }} | |
rc_release: | |
name: Tag and Release version ${{ needs.create-next-release-branch.outputs.new_branch }}rc0 from branch ${{ needs.create-next-release-branch.outputs.new_branch }} | |
secrets: inherit | |
permissions: | |
checks: read | |
contents: write | |
uses: ./.github/workflows/tag.yml | |
needs: create-next-release-branch | |
with: | |
version: ${{ needs.create-next-release-branch.outputs.new_branch }}rc0 | |
from_branch: ${{ needs.create-next-release-branch.outputs.new_branch }} |