mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 22:56:55 +01:00
Bumps the github-actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/github-script](https://github.com/actions/github-script) and [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/checkout` from 4.4.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](11d5960a32...3d3c42e5aa) Updates `actions/github-script` from 7.1.0 to 9.0.0 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](f28e40c7f3...3a2844b7e9) Updates `actions/setup-python` from 5.6.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](a26af69be9...5fda3b95a4) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-python dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
69 lines
2.2 KiB
YAML
69 lines
2.2 KiB
YAML
# Cuts a BCQuality content release on demand (roughly monthly), NOT on every
|
|
# commit. Run this workflow manually once the `main` content is ready, and choose
|
|
# whether to bump the minor (usual periodic content update) or the major
|
|
# (breaking change).
|
|
#
|
|
# The version is a `major.minor` value derived from existing git tags — there is
|
|
# no VERSION file. The minor is a monotonic counter: it only ever increments and
|
|
# never resets, even across a major bump, so it uniquely identifies a release.
|
|
# This workflow computes the next version and tags the current commit as
|
|
# `v{major}.{minor}`.
|
|
|
|
name: Release version
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump:
|
|
description: Which part to bump
|
|
type: choice
|
|
options:
|
|
- minor
|
|
- major
|
|
default: minor
|
|
|
|
# Only tag creation needs write.
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: release-version
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Compute and tag release
|
|
shell: bash
|
|
run: |
|
|
git fetch --tags --force --quiet
|
|
tags="$(git tag -l | grep -E '^v[0-9]+\.[0-9]+$' || true)"
|
|
|
|
if [[ -z "$tags" ]]; then
|
|
# First release.
|
|
major=1
|
|
minor=0
|
|
else
|
|
latest_major="$(printf '%s\n' "$tags" | sed -E 's/^v([0-9]+)\..*/\1/' | sort -n | tail -1)"
|
|
latest_minor="$(printf '%s\n' "$tags" | sed -E 's/^v[0-9]+\.([0-9]+)$/\1/' | sort -n | tail -1)"
|
|
minor=$(( latest_minor + 1 )) # monotonic, never resets
|
|
if [[ "${{ inputs.bump }}" == "major" ]]; then
|
|
major=$(( latest_major + 1 ))
|
|
else
|
|
major="$latest_major"
|
|
fi
|
|
fi
|
|
|
|
tag="v${major}.${minor}"
|
|
if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
|
|
echo "::error::Tag ${tag} already exists"
|
|
exit 1
|
|
fi
|
|
git tag "$tag" "${{ github.sha }}"
|
|
git push origin "$tag"
|
|
echo "Released BCQuality ${tag} at ${{ github.sha }}"
|