chore(release): prepare 1.0.17 #42
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| # Docs-only pushes skip CI. Tag pushes always run: path filters are | |
| # bypassed for newly created refs. | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "skills/**" | |
| - "LICENSE" | |
| - ".gitignore" | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "skills/**" | |
| - "LICENSE" | |
| - ".gitignore" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| SPARKLE_VERSION: 2.9.4 | |
| jobs: | |
| test: | |
| name: Test Rust core | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: host-tests | |
| - name: Test Rust core | |
| run: cargo test --manifest-path koe-core/Cargo.toml | |
| build-arm64: | |
| name: Build macOS arm64 | |
| needs: test | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: aarch64-apple-darwin | |
| - name: Install dependencies | |
| run: brew install xcodegen cmake | |
| env: | |
| HOMEBREW_NO_AUTO_UPDATE: 1 | |
| - name: Cache Swift packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: KoeApp/build-ci/SourcePackages | |
| key: spm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('KoeApp/project.yml', 'Packages/**/Package.swift', 'Packages/**/Package.resolved') }} | |
| restore-keys: | | |
| spm-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Show Xcode and Swift versions | |
| run: | | |
| xcodebuild -version | |
| swift --version | |
| - name: Import Developer ID certificate | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| CERTIFICATE_P12_BASE64: ${{ secrets.MACOS_CERTIFICATE_P12 }} | |
| CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
| run: | | |
| set -euo pipefail | |
| CERTIFICATE_PATH="$RUNNER_TEMP/certificate.p12" | |
| KEYCHAIN_PATH="$RUNNER_TEMP/build.keychain-db" | |
| KEYCHAIN_PASSWORD=$(openssl rand -hex 24) | |
| echo "$CERTIFICATE_P12_BASE64" | base64 --decode -o "$CERTIFICATE_PATH" | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security import "$CERTIFICATE_PATH" -P "$CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" | |
| security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security list-keychain -d user -s "$KEYCHAIN_PATH" | |
| rm -f "$CERTIFICATE_PATH" | |
| echo "CODESIGN_IDENTITY=Developer ID Application" >> "$GITHUB_ENV" | |
| - name: Set up Sparkle signing | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| SPARKLE_ED25519_PUBLIC_KEY: ${{ secrets.SPARKLE_ED25519_PUBLIC_KEY }} | |
| SPARKLE_ED25519_PRIVATE_KEY: ${{ secrets.SPARKLE_ED25519_PRIVATE_KEY }} | |
| run: | | |
| set -euo pipefail | |
| curl -fL "https://github.com/sparkle-project/Sparkle/releases/download/${SPARKLE_VERSION}/Sparkle-${SPARKLE_VERSION}.tar.xz" \ | |
| -o "$RUNNER_TEMP/sparkle.tar.xz" | |
| mkdir -p "$RUNNER_TEMP/sparkle" | |
| tar -xJf "$RUNNER_TEMP/sparkle.tar.xz" -C "$RUNNER_TEMP/sparkle" | |
| xattr -dr com.apple.quarantine "$RUNNER_TEMP/sparkle" || true | |
| KEY_FILE="$RUNNER_TEMP/sparkle_ed25519.key" | |
| printf '%s' "$SPARKLE_ED25519_PRIVATE_KEY" > "$KEY_FILE" | |
| chmod 600 "$KEY_FILE" | |
| /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_ED25519_PUBLIC_KEY" KoeApp/Koe/Info.plist | |
| echo "SPARKLE_BIN=$RUNNER_TEMP/sparkle/bin" >> "$GITHUB_ENV" | |
| echo "SPARKLE_PRIVATE_KEY_FILE=$KEY_FILE" >> "$GITHUB_ENV" | |
| - name: Build CLI | |
| run: cargo build --package koe-cli --release --target aarch64-apple-darwin | |
| - name: Generate Xcode project | |
| run: xcodegen generate --spec project.yml | |
| working-directory: KoeApp | |
| - name: Build app | |
| run: | | |
| set -euo pipefail | |
| xcodebuild \ | |
| -project Koe.xcodeproj \ | |
| -scheme Koe \ | |
| -configuration Release \ | |
| -skipPackagePluginValidation \ | |
| -skipMacroValidation \ | |
| -derivedDataPath build-ci/standard \ | |
| -clonedSourcePackagesDirPath build-ci/SourcePackages \ | |
| ARCHS=arm64 \ | |
| ONLY_ACTIVE_ARCH=NO \ | |
| build | |
| working-directory: KoeApp | |
| - name: Package app | |
| env: | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: | | |
| .github/scripts/package-app.sh \ | |
| "KoeApp/build-ci/standard/Build/Products/Release/Koe.app" \ | |
| "target/aarch64-apple-darwin/release/koe" \ | |
| Koe-macOS-arm64.zip | |
| - name: Build MLX app | |
| run: | | |
| set -euo pipefail | |
| xcodebuild \ | |
| -project Koe.xcodeproj \ | |
| -scheme Koe-MLX \ | |
| -configuration Release \ | |
| -skipPackagePluginValidation \ | |
| -skipMacroValidation \ | |
| -derivedDataPath build-ci/mlx \ | |
| -clonedSourcePackagesDirPath build-ci/SourcePackages \ | |
| ARCHS=arm64 \ | |
| ONLY_ACTIVE_ARCH=NO \ | |
| build | |
| working-directory: KoeApp | |
| - name: Package MLX app | |
| env: | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: | | |
| .github/scripts/package-app.sh \ | |
| "KoeApp/build-ci/mlx/Build/Products/Release/Koe.app" \ | |
| "target/aarch64-apple-darwin/release/koe" \ | |
| Koe-MLX-macOS-arm64.zip | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Koe-macOS-arm64 | |
| path: | | |
| Koe-macOS-arm64.zip | |
| Koe-macOS-arm64.zip.sparkle.json | |
| if-no-files-found: error | |
| - name: Upload MLX build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Koe-MLX-macOS-arm64 | |
| path: | | |
| Koe-MLX-macOS-arm64.zip | |
| Koe-MLX-macOS-arm64.zip.sparkle.json | |
| if-no-files-found: error | |
| - name: Clean up signing material | |
| if: always() | |
| run: | | |
| security delete-keychain "$RUNNER_TEMP/build.keychain-db" 2>/dev/null || true | |
| rm -f "$RUNNER_TEMP/sparkle_ed25519.key" | |
| release: | |
| name: Create GitHub Release | |
| needs: build-arm64 | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: main | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/*.zip | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update Sparkle appcasts on main | |
| if: ${{ !contains(github.ref_name, '-') }} | |
| run: | | |
| set -euo pipefail | |
| python3 .github/scripts/update-feeds.py \ | |
| --tag "${GITHUB_REF_NAME}" \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --dist dist | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add docs/appcast.xml docs/appcast-mlx.xml docs/update-feed.json | |
| if git diff --cached --quiet; then | |
| echo "No feed changes to commit" | |
| exit 0 | |
| fi | |
| git commit -m "chore(release): update appcasts for ${GITHUB_REF_NAME}" | |
| git pull --rebase origin main | |
| git push origin HEAD:main |