-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.28 KB
/
cut-release.yml
File metadata and controls
45 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Cut Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Bump frontend version
run: |
cd frontend
yarn version --patch --no-git-tag-version
- name: Get the latest tag
id: get_latest_tag
env:
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
run: |
latest_tag=$(gh release list --limit 1 --json tagName -q '.[0].tagName')
echo "latest_tag=$latest_tag" >> $GITHUB_OUTPUT
- name: Bump version
id: bump_version
run: |
latest_tag=${{ steps.get_latest_tag.outputs.latest_tag }}
IFS='.' read -r -a version_parts <<< "${latest_tag#v}"
major=${version_parts[0]}
minor=${version_parts[1]}
patch=${version_parts[2]}
new_patch=$((patch + 1))
new_tag="v${major}.${minor}.${new_patch}"
echo "::set-output name=new_tag::$new_tag"
- name: Create and push new tag
run: |
new_tag=${{ steps.bump_version.outputs.new_tag }}
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag $new_tag
git push origin $new_tag