Skip to content

Commit c0ea245

Browse files
authored
feat: Create additional tag on release for google-cloud-shared-dependencies (#1692)
* test workflow to add new tag to release * test with token for forked repo * forked repo * add distribution * update pom path * edit permissions * update workflow to use versions.txt file instead of pom.xml * test workflow on forked repo only * remove release tag needed for fork only * parsing versions.txt means we don't need maven, so removing java setup * fix workflow * add back in manual input * update name of workflow * update to create multiple tags * update name of workflow * add newline * fix typo
1 parent 745ea58 commit c0ea245

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Create additional tags for each release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch: # If manually triggered, clarify which release to create the additional tags for
7+
inputs:
8+
releaseTag:
9+
description: 'Release Tag'
10+
required: true
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions: write-all
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
with:
20+
ref: ${{ github.event.inputs.releaseTag }}
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Set up Git
24+
run: |
25+
git config --local user.email "[email protected]"
26+
git config --local user.name "GitHub Action"
27+
28+
- name: Create additional tags
29+
run: |
30+
ARTIFACT_IDS=('google-cloud-shared-dependencies' 'api-common' 'gax')
31+
for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"
32+
do
33+
VERSION=$(grep "${ARTIFACT_ID}" versions.txt | cut -d':' -f2)
34+
git tag ${ARTIFACT_ID}/$VERSION ${{ github.event.inputs.releaseTag }}
35+
git push origin ${ARTIFACT_ID}/$VERSION
36+
done

0 commit comments

Comments
 (0)