Skip to content

Commit

Permalink
[ADD] workflow: update main release of gha
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnuttinck committed Sep 20, 2024
1 parent 3d9a9bc commit 6245ee9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,18 @@ jobs:
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
-F NOTES.md
-F NOTES.md
- name: Get Main version
run: |
main_version=$(echo ${{ github.ref_name }} | cut -d '.' -f 1)
echo "Main version: $main_version"
echo "::set-output name=main_version::$main_version"
- name: Update Main version
if: ${{ !env.ACT }} # do not run locally
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
main_version: ${{ steps.Get-Main-Version.outputs.main_version }}
target: ${{ github.ref_name }}
run: |
gh tag -f ${{ env.main_version }} ${{ env.target }}
gh push origin ${{ env.main_version }} --force
27 changes: 27 additions & 0 deletions .github/workflows/update-main-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update Main Version
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}

on:
workflow_dispatch:

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Get Main version
run: |
main_version=$(echo ${{ github.ref_name }} | cut -d '.' -f 1)
echo "Main version: $main_version"
echo "::set-output name=main_version::$main_version"
- name: Update Main version
if: ${{ !env.ACT }} # do not run locally
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
main_version: ${{ steps.Get-Main-Version.outputs.main_version }}
target: ${{ github.ref_name }}
run: |
gh tag -f ${{ env.main_version }} ${{ env.target }}
gh push origin ${{ env.main_version }} --force

0 comments on commit 6245ee9

Please sign in to comment.