From 59b47bfacec93d996484264d1fd87f7a2450d8d7 Mon Sep 17 00:00:00 2001 From: Iceman Date: Tue, 24 Mar 2026 14:45:35 +0900 Subject: [PATCH 1/4] Disable re-archive artifactbundle --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1596b42c..85e2aa35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,15 +69,17 @@ jobs: merge-multiple: true - run: bundle/make_artifactbundle.sh ${{ github.event.release.tag_name || github.ref_name }} + - name: Upload artifact bundle - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: mockolo.artifactbundle.zip path: mockolo.artifactbundle.zip + archive: false - name: Compute checksum id: checksum - run: echo "checksum=$(swift package compute-checksum mockolo.artifactbundle.zip)" >> "$GITHUB_OUTPUT" + run: echo "checksum=$(swift package compute-checksum mockolo.artifactbundle.zip)" | tee -a "$GITHUB_OUTPUT" deploy-binary: if: ${{ github.event_name == 'release' }} From d6d0a72ac6558d60ece5ca2b4984035b80f1d165 Mon Sep 17 00:00:00 2001 From: Iceman Date: Tue, 24 Mar 2026 15:17:19 +0900 Subject: [PATCH 2/4] Publish to github releases in Actions --- .github/workflows/release.yml | 39 ++++++++++++++++++++------ Sources/Mockolo/Mockolo.swift | 2 +- Sources/Mockolo/Version.swift | 1 + Sources/MockoloFramework/Version.swift | 7 ----- 4 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 Sources/Mockolo/Version.swift delete mode 100644 Sources/MockoloFramework/Version.swift diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85e2aa35..e634c6ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,23 @@ name: Release on: workflow_dispatch: - release: - types: [published] + inputs: + version: + description: "Version to release (e.g. 2.7.0)" + required: true + type: string + release_notes: + description: "Release notes body" + required: true + type: string + dry_run: + description: "Build and validate only (do not create release/tag)" + required: true + default: true + type: boolean + +permissions: + contents: write jobs: build: @@ -24,6 +39,8 @@ jobs: run: sudo xcode-select -s /Applications/Xcode_26.1.app - uses: actions/checkout@v6 + - name: Update Sources/Mockolo/Version.swift + run: echo "let version = \"${{ inputs.version }}\"" > Sources/Mockolo/Version.swift - name: Create the binary run: ./install-script.sh -s . -t mockolo -d . -o mockolo.${{ matrix.destination.name }}.tar.gz - name: Upload the binary @@ -68,7 +85,7 @@ jobs: with: merge-multiple: true - - run: bundle/make_artifactbundle.sh ${{ github.event.release.tag_name || github.ref_name }} + - run: bundle/make_artifactbundle.sh "${{ inputs.version }}" - name: Upload artifact bundle uses: actions/upload-artifact@v7 @@ -81,18 +98,23 @@ jobs: id: checksum run: echo "checksum=$(swift package compute-checksum mockolo.artifactbundle.zip)" | tee -a "$GITHUB_OUTPUT" - deploy-binary: - if: ${{ github.event_name == 'release' }} + publish: + if: ${{ !inputs.dry_run }} needs: [check-portability, make-artifact-bundle] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v7 with: merge-multiple: true - - name: Deploy the binary + - name: Publish to GitHub Releases uses: softprops/action-gh-release@v2 with: + name: v${{ inputs.version }} + tag_name: v${{ inputs.version }} + target_commitish: ${{ github.sha }} body: | + ${{ inputs.release_notes }} + ---- ## For Build Tools Plugin (artifactbundle) @@ -100,14 +122,15 @@ jobs: ```swift .binaryTarget( name: "mockolo", - url: "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/mockolo.artifactbundle.zip", + url: "https://github.com/${{ github.repository }}/releases/download/v${{ inputs.version }}/mockolo.artifactbundle.zip", checksum: "${{ needs.make-artifact-bundle.outputs.checksum }}" ), ``` - append_body: true files: | mockolo.ubuntu-x86_64.tar.gz mockolo.ubuntu-aarch64.tar.gz mockolo.macos-universal.tar.gz mockolo.artifactbundle.zip + fail_on_unmatched_files: true + draft: true diff --git a/Sources/Mockolo/Mockolo.swift b/Sources/Mockolo/Mockolo.swift index a81adaf4..bddf9e90 100644 --- a/Sources/Mockolo/Mockolo.swift +++ b/Sources/Mockolo/Mockolo.swift @@ -22,7 +22,7 @@ struct Mockolo { static func main() { let inputs = Array(CommandLine.arguments.dropFirst()) if let arg = inputs.first, (arg == "--version" || arg == "-v") { - print(Version.current.value) + print(version) return } diff --git a/Sources/Mockolo/Version.swift b/Sources/Mockolo/Version.swift new file mode 100644 index 00000000..ff448151 --- /dev/null +++ b/Sources/Mockolo/Version.swift @@ -0,0 +1 @@ +let version = "development" diff --git a/Sources/MockoloFramework/Version.swift b/Sources/MockoloFramework/Version.swift deleted file mode 100644 index 41196a13..00000000 --- a/Sources/MockoloFramework/Version.swift +++ /dev/null @@ -1,7 +0,0 @@ -public struct Version { - /// The string value for this version. - public let value: String - - /// The current Mockolo version. - public static let current = Version(value: "2.6.0") -} From 1f8f411fc51590d986aa5fcd4649b01a0f50ab12 Mon Sep 17 00:00:00 2001 From: Iceman Date: Tue, 24 Mar 2026 15:45:34 +0900 Subject: [PATCH 3/4] some fix --- .github/workflows/release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e634c6ee..8b4f96f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,14 +29,14 @@ jobs: destination: - { name: "ubuntu-aarch64", os: ubuntu-22.04-arm } - { name: "ubuntu-x86_64", os: ubuntu-22.04 } - - { name: "macos-universal", os: macos-15 } + - { name: "macos-universal", os: macos-26 } steps: - if: startsWith(matrix.destination.name, 'ubuntu') uses: vapor/swiftly-action@v0.2 with: toolchain: "6.2" - if: startsWith(matrix.destination.name, 'macos') - run: sudo xcode-select -s /Applications/Xcode_26.1.app + run: sudo xcode-select -s /Applications/Xcode_26.3.app - uses: actions/checkout@v6 - name: Update Sources/Mockolo/Version.swift @@ -122,7 +122,7 @@ jobs: ```swift .binaryTarget( name: "mockolo", - url: "https://github.com/${{ github.repository }}/releases/download/v${{ inputs.version }}/mockolo.artifactbundle.zip", + url: "https://github.com/${{ github.repository }}/releases/download/${{ inputs.version }}/mockolo.artifactbundle.zip", checksum: "${{ needs.make-artifact-bundle.outputs.checksum }}" ), ``` @@ -132,5 +132,4 @@ jobs: mockolo.ubuntu-aarch64.tar.gz mockolo.macos-universal.tar.gz mockolo.artifactbundle.zip - fail_on_unmatched_files: true draft: true From 60adf12da926ed6a495abb9eeae48388fc1a3edd Mon Sep 17 00:00:00 2001 From: Iceman Date: Tue, 24 Mar 2026 16:03:28 +0900 Subject: [PATCH 4/4] skip decompress --- .github/workflows/release.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b4f96f9..ee895f6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,14 +7,9 @@ on: description: "Version to release (e.g. 2.7.0)" required: true type: string - release_notes: - description: "Release notes body" - required: true - type: string dry_run: - description: "Build and validate only (do not create release/tag)" + description: "Dry run" required: true - default: true type: boolean permissions: @@ -106,17 +101,14 @@ jobs: - uses: actions/download-artifact@v7 with: merge-multiple: true + skip-decompress: true - name: Publish to GitHub Releases uses: softprops/action-gh-release@v2 with: - name: v${{ inputs.version }} - tag_name: v${{ inputs.version }} + name: ${{ inputs.version }} + tag_name: ${{ inputs.version }} target_commitish: ${{ github.sha }} body: | - ${{ inputs.release_notes }} - - ---- - ## For Build Tools Plugin (artifactbundle) ```swift @@ -126,10 +118,11 @@ jobs: checksum: "${{ needs.make-artifact-bundle.outputs.checksum }}" ), ``` - + generate_release_notes: true files: | mockolo.ubuntu-x86_64.tar.gz mockolo.ubuntu-aarch64.tar.gz mockolo.macos-universal.tar.gz mockolo.artifactbundle.zip + fail_on_unmatched_files: true draft: true