Tagging 4.4.x as v4.4.1 [Overwrite] #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tag and Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
required: true | |
overwrite: | |
description: Force push tag | |
type: boolean | |
default: false | |
run-name: Tagging ${{github.ref_name}} as v${{inputs.version}}${{inputs.overwrite && ' [Overwrite]' || ''}} | |
jobs: | |
tag: | |
environment: TestPypi # Enforcing deployment branches permissions | |
runs-on: ubuntu-latest | |
permissions: | |
checks: read | |
contents: write | |
env: | |
BASH_FUNC_tag_and_push%%: |- | |
() { | |
sed -ri '/^\[metadata]/, /^\[/ s/^version[[:blank:]]*=.*/version = '$2/ setup.cfg | |
sed -i "/__version__ =/d" python/arcticdb/__init__.py | |
echo "__version__ = \"$2\"" >> python/arcticdb/__init__.py | |
git add setup.cfg README.md python/arcticdb/__init__.py | |
git status | |
git diff --cached --exit-code || git commit -m "$1 v$2" | |
set -x | |
git push origin HEAD:$3 $4 | |
} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
token: ${{secrets.TAGGING_TOKEN}} | |
- name: Tag required version | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git switch -C tagging ${{github.ref}} | |
# Remove the build status badge from a version tag | |
sed -i 's#<img src="https://github.com/man-group/ArcticDB/actions/workflows/build.yml/badge.svg"/>##' README.md || true | |
tag_and_push "Tagging" ${{inputs.version}} refs/tags/v${{inputs.version}} ${{inputs.overwrite && '-f' || ''}} |