Skip to content

Commit 25081b1

Browse files
committed
Change tagged_release.yml
1 parent 484c643 commit 25081b1

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

.github/workflows/tagged_release.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: "Create Tagged Release"
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: 'Version number of the release'
8+
required: true
79

810
jobs:
911
gh_tagged_release:
@@ -14,6 +16,11 @@ jobs:
1416
- name: Checkout project
1517
uses: actions/checkout@v3
1618

19+
- name: Setup Git
20+
run: |
21+
git config user.name github-actions
22+
git config user.email [email protected]
23+
1724
- name: Cache node modules
1825
uses: actions/cache@v3
1926
env:
@@ -32,13 +39,23 @@ jobs:
3239
cache: 'npm'
3340
cache-dependency-path: '**/package-lock.json'
3441

35-
- name: Set tag version
42+
- name: Set versions
3643
run: |
37-
echo "tagVersion=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
38-
yq eval -i '.version = "${{ env.tagVersion }}"' documentation/js-sdk-guide/antora.yml
44+
release_version=${{ github.event.inputs.release_version }}
45+
release_branch_name=${release_version%.*}.x
46+
echo "release_branch_name=$release_branch_name" >> $GITHUB_ENV
3947
4048
- name: Set antora version
41-
run: yq eval -i '.version = env.TAGVERSION' documentation/js-sdk-guide/antora.yml
49+
run: yq eval -i '.version = "${{ github.event.inputs.release_version }}"' documentation/js-sdk-guide/antora.yml
50+
51+
- name: Commit version changes and push to upstream repository
52+
uses: stefanzweifel/git-auto-commit-action@v4
53+
with:
54+
branch: ${{ env.release_branch_name }}
55+
commit_user_name: github-actions
56+
commit_user_email: [email protected]
57+
commit_author: Author <[email protected]>
58+
file_pattern: 'documentation/js-sdk-guide/antora.yml'
4259

4360
- name: Install Dependencies
4461
run: npm install
@@ -60,8 +77,8 @@ jobs:
6077
overwrite: true
6178
prerelease: false
6279
repo_token: ${{ secrets.GITHUB_TOKEN }}
63-
file: esmf-semantic-ui-schematics-${{ env.tagVersion }}.tgz
64-
tag: ${{ github.ref }}
80+
file: esmf-semantic-ui-schematics-${{ github.event.inputs.release_version }}.tgz
81+
tag: v${{ github.event.inputs.release_version }}
6582

6683
- name: Create GitHub pre-release
6784
if: ${{ (contains( github.ref, '-rc' )) }}
@@ -70,5 +87,5 @@ jobs:
7087
overwrite: true
7188
prerelease: true
7289
repo_token: ${{ secrets.GITHUB_TOKEN }}
73-
file: esmf-semantic-ui-schematics-${{ env.tagVersion }}.tgz
74-
tag: ${{ github.ref }}
90+
file: esmf-semantic-ui-schematics-${{ github.event.inputs.release_version }}.tgz
91+
tag: v${{ github.event.inputs.release_version }}

0 commit comments

Comments
 (0)