Skip to content

Create Release Branches #1

Create Release Branches

Create Release Branches #1

name: Pre-Release - Create Release Branches
on:
workflow_call:
inputs:
version_to_release:
required: true
type: string
next_version:
required: true
type: string
workflow_dispatch:
inputs:
version_to_release:
description: 'Version to release. Specify <major.minor> only, without the patch number, e.g. 6.3. A new branch called "release/<version>" will be created where the release-specific changes will be committed.'
required: true
next_version:
description: 'Next version. Specify <major.minor>, e.g. 6.4 (Do NOT include -SNAPSHOT, will be added automatically)'
required: true
jobs:
release-branch:
name: Create Release Branches
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Configure git
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email '[email protected]'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout SDK
uses: actions/checkout@v4
with:
ref: master
- name: Create SDK Release Branch "release/${{ github.event.inputs.version_to_release }}"
run: |
git checkout -b release/${{ github.event.inputs.version_to_release }}
- name: Set version in gradle.properties
run: |
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.version_to_release }}.0#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: change version to be released: ${{ github.event.inputs.version_to_release }}.0"
git push --set-upstream origin release/${{ github.event.inputs.version_to_release }}
- name: Set next SDK version
run: |
git checkout master
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT"
git push
- name: Checkout Swazzler
uses: actions/checkout@v4
with:
repository: embrace-io/embrace-swazzler3
ref: master
token: ${{ secrets.CD_GITHUB_TOKEN }}
- name: Create Swazzler Release Branch "release/${{ github.event.inputs.version_to_release }}"
run: |
git checkout -b release/${{ github.event.inputs.version_to_release }}
- name: Set version in gradle.properties
run: |
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.version_to_release }}.0#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: change version to be released: ${{ github.event.inputs.version_to_release }}.0"
git push --set-upstream origin release/${{ github.event.inputs.version_to_release }}
- name: Set Next Swazzler Version
run: |
git checkout master
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT"
git push