From 5113c05f9622ff9e0ded06e0df9d1d0bd7c223c6 Mon Sep 17 00:00:00 2001 From: ikesyo Date: Thu, 16 Jan 2025 12:27:26 +0900 Subject: [PATCH 1/3] Make release workflow enable to trigger manually --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 431da157..7ef3c3d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,12 @@ on: release: types: [created] + workflow_dispatch: + inputs: + tag: + description: 'Tag to build and upload artifact bundle for' + required: true + default: ${{ github.ref_name }} name: Upload Artifact Bundle to Release env: @@ -21,7 +27,7 @@ jobs: swift build --disable-sandbox -c release --arch arm64 swift build --disable-sandbox -c release --arch x86_64 - name: Get Current Tag - run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + run: echo "TAG_NAME=${{ inputs.tag || github.ref_name }}" >> $GITHUB_ENV - name: Make Artifact Bundle run: | swift package --allow-writing-to-package-directory generate-artifact-bundle \ From f30e893dbf0313e598692b19ad459759c17aa3f7 Mon Sep 17 00:00:00 2001 From: ikesyo Date: Thu, 16 Jan 2025 14:26:42 +0900 Subject: [PATCH 2/3] Use `published` type over `created` type for `release` trigger --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ef3c3d4..8131c0db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ on: release: - types: [created] + types: [published] workflow_dispatch: inputs: tag: From fa9a0cf2392ada3c83b53ddc770ace88320a0daf Mon Sep 17 00:00:00 2001 From: ikesyo Date: Fri, 17 Jan 2025 09:43:51 +0900 Subject: [PATCH 3/3] Use `github.event.release.tag_name` --- .github/workflows/release.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8131c0db..9f692bf6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,8 @@ on: release: types: [published] + # Use with only Tags workflow_dispatch: - inputs: - tag: - description: 'Tag to build and upload artifact bundle for' - required: true - default: ${{ github.ref_name }} name: Upload Artifact Bundle to Release env: @@ -27,7 +23,7 @@ jobs: swift build --disable-sandbox -c release --arch arm64 swift build --disable-sandbox -c release --arch x86_64 - name: Get Current Tag - run: echo "TAG_NAME=${{ inputs.tag || github.ref_name }}" >> $GITHUB_ENV + run: echo "TAG_NAME=${{ github.event.release.tag_name || github.ref_name }}" >> $GITHUB_ENV - name: Make Artifact Bundle run: | swift package --allow-writing-to-package-directory generate-artifact-bundle \