diff --git a/.github/workflows/create_additional_release_tag.yaml b/.github/workflows/create_additional_release_tag.yaml new file mode 100644 index 0000000000..4270461be5 --- /dev/null +++ b/.github/workflows/create_additional_release_tag.yaml @@ -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