Skip to content

Commit

Permalink
feat: Create additional tag on release for google-cloud-shared-depend…
Browse files Browse the repository at this point in the history
…encies (#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
  • Loading branch information
alicejli authored May 22, 2023
1 parent 745ea58 commit c0ea245
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/create_additional_release_tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create additional tags for each release

on:
release:
types: [published]
workflow_dispatch: # If manually triggered, clarify which release to create the additional tags for
inputs:
releaseTag:
description: 'Release Tag'
required: true

jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.releaseTag }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Create additional tags
run: |
ARTIFACT_IDS=('google-cloud-shared-dependencies' 'api-common' 'gax')
for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"
do
VERSION=$(grep "${ARTIFACT_ID}" versions.txt | cut -d':' -f2)
git tag ${ARTIFACT_ID}/$VERSION ${{ github.event.inputs.releaseTag }}
git push origin ${ARTIFACT_ID}/$VERSION
done

0 comments on commit c0ea245

Please sign in to comment.