mirror of
https://github.com/ditkrg/build-image-workflow.git
synced 2026-01-22 23:27:06 +00:00
Merge pull request #9 from ditkrg/add-major-tag-update
Add workflow to update main version tag
This commit is contained in:
commit
ed63a1b7e6
32
.github/workflows/update-main-version.yaml
vendored
Normal file
32
.github/workflows/update-main-version.yaml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: Release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v[0-9]+.[0-9]+.[0-9]+
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
tag=${GITHUB_REF/refs\/tags\//}
|
||||||
|
version=${tag#v}
|
||||||
|
major=${version%%.*}
|
||||||
|
echo "tag=${tag}" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||||
|
echo "major=${major}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: force update major tag
|
||||||
|
run: |
|
||||||
|
git config user.name github-actions
|
||||||
|
git config user.email github-actions@github.com
|
||||||
|
|
||||||
|
git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f
|
||||||
|
git push origin refs/tags/v${{ steps.version.outputs.major }} -f
|
||||||
Loading…
Reference in New Issue
Block a user