Skip to content

Create release

Create release #21

# Simple workflow for deploying static content to GitHub Pages
name: Create Release
on:
# Run when Docs workflow completes
workflow_run:
branches:
- main
workflows: [Clients]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
# Allow one concurrent deployment
concurrency:
group: "create-release"
cancel-in-progress: true
jobs:
create-release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'api-clients'
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Check release version
run: |
# Extract release version from galv-spec.json
RELEASE_VERSION=$(jq -r '.info.version' galv-spec.json)
echo "Release version: $RELEASE_VERSION"
# Check if release version already exists
if git rev-parse "release/v$RELEASE_VERSION" >/dev/null 2>&1; then
echo "Release version $RELEASE_VERSION already exists"
exit 1
fi
- name: Create release branch
run: |
# Extract release version from galv-spec.json
RELEASE_VERSION=$(jq -r '.info.version' galv-spec.json)
echo "Release version: $RELEASE_VERSION"
# Create release branch
git checkout -b "release/v$RELEASE_VERSION"
git push --set-upstream origin "release/v$RELEASE_VERSION"