Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update tag workflow #1699

Merged
merged 2 commits into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/create_additional_release_tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ 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
workflow_dispatch:

jobs:
build:
Expand All @@ -17,7 +13,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.releaseTag }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Git
Expand All @@ -28,9 +23,13 @@ jobs:
- 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
for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"; do
VERSION=$(grep "^${ARTIFACT_ID}:" versions.txt | cut -d':' -f2 | tr -d '[:space:]')
TAG_NAME="${ARTIFACT_ID}/v$VERSION"
if git show-ref --tags | grep -q "refs/tags/$TAG_NAME"; then
echo "Tag $TAG_NAME already exists. Skipping."
continue
fi
git tag $TAG_NAME
git push origin $TAG_NAME
done