-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: false | ||
description: The tag to move major version tag to | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: version | ||
id: version | ||
env: | ||
INPUT_TAG: ${{ inputs.tag }} | ||
run: | | ||
if [[ "${INPUT_TAG}" =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then | ||
tag="${INPUT_TAG}" | ||
fi | ||
if [[ ! -z "${GITHUB_REF}" ]] && [[ "${GITHUB_REF}" =~ ^refs/tags/v[0-9]+.[0-9]+.[0-9]+$ ]]; then | ||
tag=${GITHUB_REF/refs\/tags\//} | ||
fi | ||
if [[ -z "${tag}" ]]; then | ||
echo "No tag found" | ||
exit 1 | ||
fi | ||
version=${tag#v} | ||
major=${version%%.*} | ||
echo "::set-output name=tag::${tag}" | ||
echo "::set-output name=version::${version}" | ||
echo "::set-output name=major::${major}" | ||
- name: force update major tag | ||
run: | | ||
git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f | ||
git push origin refs/tags/v${{ steps.version.outputs.major }} -f |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# github-reusable-workflows | ||
|
||
Repository for reusable workflows | ||
|
||
## Other workflows | ||
|
||
We do host some non reusable workflows that is meant to be consumed by repository as in any workflows files starting with `self-` |