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 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/create_additional_release_tag.yaml
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 @@ -30,7 +25,13 @@ jobs:
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
VERSION=$(grep "^${ARTIFACT_ID}:" versions.txt | cut -d':' -f2 | tr -d '[:space:]')
alicejli marked this conversation as resolved.
Show resolved Hide resolved
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 ${{ github.event.inputs.releaseTag }}
alicejli marked this conversation as resolved.
Show resolved Hide resolved
git push origin $TAG_NAME
done