Skip to content

Release to Live

Release to Live #43

Workflow file for this run

# Releases from sf-qa branch to Live production server.
name: "Release to Live"
concurrency: deploy-prod
on:
workflow_dispatch:
inputs:
release-level:
description: "The level of release. This will bump the major.minor.patch version number accordingly."
required: true
default: "patch"
type: choice
options:
- "patch"
- "minor"
- "major"
skip-branch-update:
description: "Skip updating the release branch, and just release the tip of the branch as it currently exists. This can be used to release a hotfix, provided you've already pushed it to the release branch. If this is set, the 'version from which to release' is ignored."
required: true
type: boolean
default: false
from-staging-version:
description: "QA version from which to release (eg '123' or '234'). Leave blank for latest."
required: false
type: string
default: ""
jobs:
determine_build_commit:
name: "Determine commit from which to build"
runs-on: ubuntu-latest
outputs:
build_commit: "${{ steps.get_commit.outputs.build_commit }}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Use existing branch sf-live
if: ${{ github.event.inputs.skip-branch-update == 'true' }}
run: git checkout sf-live
- name: Use latest branch sf-qa
if: ${{ github.event.inputs.skip-branch-update == 'false' && github.event.inputs.from-staging-version == '' }}
run: git checkout sf-qa
- name: Use specific QA version
if: ${{ github.event.inputs.skip-branch-update == 'false' && github.event.inputs.from-staging-version != '' }}
run: git checkout "SF-QAv${{ github.event.inputs.from-staging-version }}"
- name: Get commit
id: get_commit
run: |
set -xueo pipefail
build_commit="$(git rev-parse HEAD)"
echo "build_commit=${build_commit}" >> $GITHUB_OUTPUT
- name: Details on selected build commit
run: |
set -u
build_commit="${{ steps.get_commit.outputs.build_commit }}"
echo "Using build_commit: ${build_commit}"
echo " "
echo "git describe: $(git describe "${build_commit}")"
echo " "
echo "Commit details:"
git show --stat "${build_commit}"
echo " "
echo "Commit and ancestors:"
git log --graph --decorate=short --oneline --abbrev=9 --max-count 5 "${build_commit}"
echo " "
echo "Commit in context of other branches:"
build_commit_abbrev="${build_commit:0:9}"
git log --graph --decorate=short --oneline --abbrev=9 --max-count 100 origin/sf-live origin/sf-qa origin/master | grep "${build_commit_abbrev}" --context=7 | perl -p -e "s/${build_commit_abbrev}/${build_commit_abbrev} <--/"
determine_version:
name: "Determine version"
needs: determine_build_commit
uses: ./.github/workflows/compute-next-version.yml
with:
versioning-system: "production"
release-level: ${{ github.event.inputs.release-level }}
tag_prefix: "SFv"
release_branch: "sf-live"
deploy:
name: "Deploy to Live"
needs: [determine_build_commit, determine_version]
secrets: inherit
uses: ./.github/workflows/release.yml
with:
environment: "production"
build_commit: "${{ needs.determine_build_commit.outputs.build_commit }}"
release_branch: "sf-live"
dotnet_version: "8.0.x"
node_version: "18.20.2"
npm_version: "10.9.0"
os: "ubuntu-20.04"
angular_config: "production"
app_name: "scriptureforge"
app_suffix: ""
version_number: "${{ needs.determine_version.outputs.next_version }}"
vcs_tag_prefix: "SFv"
node_options: "--max_old_space_size=4096"
project: "SIL.XForge.Scripture"
server_domain_name: "scriptureforge.org"