diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index c830c8f..6dcf90d 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -3,6 +3,12 @@ name: Publish Tagged Android Release on: push: tags: ['v*'] + workflow_dispatch: + inputs: + tag: + description: Existing immutable release tag to publish + required: true + type: string workflow_call: inputs: tag: @@ -22,9 +28,8 @@ jobs: env: INPUT_TAG: ${{ inputs.tag }} REF_TAG: ${{ github.ref_name }} - EVENT_NAME: ${{ github.event_name }} run: | - if [ "$EVENT_NAME" = "workflow_call" ]; then TAG="$INPUT_TAG"; else TAG="$REF_TAG"; fi + if [ -n "$INPUT_TAG" ]; then TAG="$INPUT_TAG"; else TAG="$REF_TAG"; fi case "$TAG" in v[0-9]*.[0-9]*.[0-9]*) ;; *) exit 2 ;; esac echo "tag=$TAG" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v6 diff --git a/scripts/test_release_workflows.py b/scripts/test_release_workflows.py index 5782f34..d3bbb15 100644 --- a/scripts/test_release_workflows.py +++ b/scripts/test_release_workflows.py @@ -32,6 +32,9 @@ def test_tagged_publication_orders_github_before_play(self): github = workflow.index('gh release create') play = workflow.index('fastlane android upload_release') self.assertLess(github, play) + self.assertIn("workflow_dispatch:", workflow) + self.assertIn('if [ -n "$INPUT_TAG" ]', workflow) + self.assertNotIn('EVENT_NAME: ${{ github.event_name }}', workflow) self.assertIn("sha256sum --check SHA256SUMS", workflow) self.assertIn("environment: release", workflow)