Skip to content

Instantly share code, notes, and snippets.

@philMarius
Created March 3, 2021 11:16
Show Gist options
  • Save philMarius/5184dce270ad9b698086b9ee9f7f8e00 to your computer and use it in GitHub Desktop.
Save philMarius/5184dce270ad9b698086b9ee9f7f8e00 to your computer and use it in GitHub Desktop.
Create release branch workflow for blog: Azure Functions Environment Separation with Linux Apps
# Release branch process
# Creates new release branch with version name
# Saves version name to artifact for release process
# Inspired by: https://riggaroo.dev/using-github-actions-to-automate-our-release-process/
name: Create Release Branch
on:
workflow_dispatch:
inputs:
version_name:
description: "Name of function version (i.e. 2.3.0)"
required: true
corvidae_release_name:
description: Corvidae release version (optional, i.e. 7)
required: false
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Create release branch
run: git checkout -b release/v${{ github.event.inputs.version_name }}
- name: Initialise mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
version: ${{ github.event.inputs.version_name }}
- name: Save version to file
run: echo "${{ github.event.inputs.version_name }}" > VERSION
- name: Commit changelog and VERSION
id: make-commit
run: |
git add CHANGELOG.md VERSION
git commit -m "Prepare release ${{ github.event.inputs.version_name }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/v${{ github.event.inputs.version_name }}
- name: Create PR into master
uses: thomaseizinger/create-pull-request@1.0.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
head: release/v${{ github.event.inputs.version_name }}
base: master
title: v${{ github.event.inputs.version_name }} into master
reviewers: ${{ github.event.issue.user.login }}
body: |
Release PR for version ${{ github.event.inputs.version_name }}.
Version name and code commit updated: ${{ steps.make-commit.outputs.commit }}
For Corvidae release: ${{ github.event.inputs.corvidae_release_name }}
- name: Create PR into develop
uses: thomaseizinger/create-pull-request@1.0.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
head: release/v${{ github.event.inputs.version_name }}
base: develop
title: v${{ github.event.inputs.version_name }} into develop
reviewers: ${{ github.event.issue.user.login }}
body: |
Release PR for version ${{ github.event.inputs.version_name }}.
Version name and code commit updated: ${{ steps.make-commit.outputs.commit }}
For Corvidae release: ${{ github.event.inputs.corvidae_release_name }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment