Skip to content

[BLD]: allow manual dispatch of JS release workflow #3536

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

Merged
merged 1 commit into from
Jan 22, 2025
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
22 changes: 20 additions & 2 deletions .github/workflows/release-javascript-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,39 @@ on:
tags:
- 'js_release_[0-9]+\.[0-9]+\.[0-9]+' # Match tags in the form js_release_X.Y.Z
- 'js_release_alpha_[0-9]+\.[0-9]+\.[0-9]+' # Match tags in the form js_release_alpha_X.Y.Z
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true

jobs:
release:
strategy:
fail-fast: false
matrix:
registry: [ "https://registry.npmjs.org", "https://npm.pkg.github.com" ]
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Resolve tag
id: tag
shell: bash
run: |
# If the workflow was triggered by a push on a tag, use github.ref_name.
# If manually dispatched, use the tag value supplied in the workflow input.
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
fi

- name: Check if tag matches the pattern
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/js_release_alpha_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "${{ steps.tag.outputs.tag }}" =~ ^js_release_alpha_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag matches the pattern js_release_alpha_X.Y.Z"
echo "NPM_SCRIPT=release_alpha" >> "$GITHUB_ENV"
elif [[ "${{ github.ref }}" =~ ^refs/tags/js_release_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
elif [[ "${{ steps.tag.outputs.tag }}" =~ ^js_release_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag matches the pattern js_release_X.Y.Z"
echo "NPM_SCRIPT=release" >> "$GITHUB_ENV"
else
Expand Down
Loading