release: v0.13.0 #107
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: Build TablePro | |
| on: | |
| push: | |
| tags: ["v*"] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - ".vscode/**" | |
| env: | |
| XCODE_PROJECT: TablePro.xcodeproj | |
| XCODE_SCHEME: TablePro | |
| BUILD_CONFIGURATION: Release | |
| jobs: | |
| lint: | |
| name: SwiftLint | |
| runs-on: self-hosted | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: brew list swiftlint &>/dev/null || brew install swiftlint | |
| - name: Run SwiftLint | |
| run: swiftlint lint --strict | |
| build-arm64: | |
| name: Build ARM64 | |
| runs-on: self-hosted | |
| needs: lint | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Install Git LFS | |
| run: brew list git-lfs &>/dev/null || brew install git-lfs; git lfs install | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Pull LFS files | |
| run: git lfs pull | |
| - name: Install ARM64 dependencies | |
| run: | | |
| echo "Installing ARM64 dependencies..." | |
| # Check and install only if needed | |
| if ! brew list mariadb-connector-c &>/dev/null; then | |
| echo "📦 Installing mariadb-connector-c..." | |
| brew install mariadb-connector-c | |
| else | |
| echo "✅ mariadb-connector-c already installed" | |
| fi | |
| # Link packages with --force and --overwrite (needed for keg-only formulas) | |
| brew link --force --overwrite mariadb-connector-c 2>/dev/null || true | |
| # Verify installations | |
| if ! brew list mariadb-connector-c >/dev/null 2>&1; then | |
| echo "❌ ERROR: mariadb-connector-c installation failed" | |
| exit 1 | |
| fi | |
| echo "✅ ARM64 dependencies installed" | |
| - name: Prepare libraries | |
| run: scripts/ci/prepare-libs.sh arm64 | |
| - name: Verify Xcode | |
| run: | | |
| echo "Active Xcode:" | |
| xcode-select -p | |
| xcodebuild -version | |
| - name: Create Secrets.xcconfig | |
| env: | |
| ANALYTICS_HMAC_SECRET: ${{ secrets.ANALYTICS_HMAC_SECRET }} | |
| run: echo "ANALYTICS_HMAC_SECRET = ${ANALYTICS_HMAC_SECRET}" > Secrets.xcconfig | |
| - name: Build ARM64 | |
| env: | |
| ANALYTICS_HMAC_SECRET: ${{ secrets.ANALYTICS_HMAC_SECRET }} | |
| run: | | |
| chmod +x scripts/build-release.sh | |
| scripts/build-release.sh arm64 | |
| - name: Verify build | |
| run: scripts/ci/verify-build.sh arm64 | |
| - name: Package artifacts | |
| run: scripts/ci/package-artifacts.sh arm64 "/tmp/tablepro-artifacts-${{ github.sha }}" | |
| build-x86_64: | |
| name: Build x86_64 | |
| runs-on: self-hosted | |
| needs: lint | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Install Git LFS | |
| run: brew list git-lfs &>/dev/null || brew install git-lfs; git lfs install | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Pull LFS files | |
| run: git lfs pull | |
| - name: Install Rosetta 2 | |
| run: | | |
| if ! arch -x86_64 /usr/bin/true 2>/dev/null; then | |
| echo "Installing Rosetta 2..." | |
| if ! softwareupdate --install-rosetta --agree-to-license; then | |
| echo "❌ ERROR: Failed to install Rosetta 2" | |
| exit 1 | |
| fi | |
| # Verify Rosetta 2 works | |
| if ! arch -x86_64 /usr/bin/true 2>/dev/null; then | |
| echo "❌ ERROR: Rosetta 2 installed but not functional" | |
| exit 1 | |
| fi | |
| echo "✅ Rosetta 2 installed" | |
| else | |
| echo "✅ Rosetta 2 already installed" | |
| fi | |
| - name: Install x86_64 Homebrew | |
| run: | | |
| if [ ! -f /usr/local/bin/brew ]; then | |
| echo "Installing x86_64 Homebrew..." | |
| if ! arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; then | |
| echo "❌ ERROR: Homebrew installation failed" | |
| exit 1 | |
| fi | |
| if [ ! -f /usr/local/bin/brew ]; then | |
| echo "❌ ERROR: Homebrew not found after installation" | |
| exit 1 | |
| fi | |
| if ! /usr/local/bin/brew --version; then | |
| echo "❌ ERROR: Homebrew not functional" | |
| exit 1 | |
| fi | |
| echo "✅ x86_64 Homebrew installed" | |
| else | |
| echo "x86_64 Homebrew already installed" | |
| if ! /usr/local/bin/brew --version; then | |
| echo "❌ ERROR: Homebrew not functional" | |
| exit 1 | |
| fi | |
| fi | |
| - name: Install x86_64 dependencies | |
| run: | | |
| echo "Installing x86_64 dependencies..." | |
| # Check and install only if needed | |
| if ! arch -x86_64 /usr/local/bin/brew list mariadb-connector-c &>/dev/null; then | |
| echo "📦 Installing mariadb-connector-c (x86_64)..." | |
| arch -x86_64 /usr/local/bin/brew install mariadb-connector-c | |
| else | |
| echo "✅ mariadb-connector-c (x86_64) already installed" | |
| fi | |
| # Link packages with --force (needed for keg-only formulas) | |
| arch -x86_64 /usr/local/bin/brew link --force --overwrite mariadb-connector-c 2>/dev/null || true | |
| # Verify installations | |
| if ! arch -x86_64 /usr/local/bin/brew list mariadb-connector-c >/dev/null 2>&1; then | |
| echo "❌ ERROR: mariadb-connector-c installation failed" | |
| exit 1 | |
| fi | |
| echo "✅ x86_64 dependencies installed" | |
| - name: Prepare libraries | |
| run: scripts/ci/prepare-libs.sh x86_64 | |
| - name: Verify Xcode | |
| run: | | |
| echo "Active Xcode:" | |
| xcode-select -p | |
| xcodebuild -version | |
| - name: Create Secrets.xcconfig | |
| env: | |
| ANALYTICS_HMAC_SECRET: ${{ secrets.ANALYTICS_HMAC_SECRET }} | |
| run: echo "ANALYTICS_HMAC_SECRET = ${ANALYTICS_HMAC_SECRET}" > Secrets.xcconfig | |
| - name: Build x86_64 | |
| env: | |
| ANALYTICS_HMAC_SECRET: ${{ secrets.ANALYTICS_HMAC_SECRET }} | |
| run: | | |
| chmod +x scripts/build-release.sh | |
| scripts/build-release.sh x86_64 | |
| - name: Verify build | |
| run: scripts/ci/verify-build.sh x86_64 | |
| - name: Package artifacts | |
| run: scripts/ci/package-artifacts.sh x86_64 "/tmp/tablepro-artifacts-${{ github.sha }}" | |
| release: | |
| name: Create GitHub Release | |
| runs-on: self-hosted | |
| needs: [build-arm64, build-x86_64] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Collect staged artifacts | |
| run: | | |
| STAGING="/tmp/tablepro-artifacts-${{ github.sha }}" | |
| mkdir -p artifacts/ | |
| cp "$STAGING"/* artifacts/ | |
| echo "✅ Artifacts collected from $STAGING" | |
| ls -lh artifacts/ | |
| - name: Verify and organize artifacts for release | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| if [ -z "$VERSION" ]; then | |
| echo "❌ ERROR: Failed to extract version from ref: $GITHUB_REF" | |
| exit 1 | |
| fi | |
| echo "Preparing artifacts for version: $VERSION" | |
| echo "Contents of artifacts directory:" | |
| ls -la artifacts/ | |
| # Note: DMG files should already have correct names from build | |
| # ZIP files need to be renamed | |
| # Rename ZIP files if they exist | |
| if [ -f "artifacts/TablePro-arm64.zip" ]; then | |
| mv artifacts/TablePro-arm64.zip "artifacts/TablePro-${VERSION}-arm64.zip" | |
| fi | |
| if [ -f "artifacts/TablePro-x86_64.zip" ]; then | |
| mv artifacts/TablePro-x86_64.zip "artifacts/TablePro-${VERSION}-x86_64.zip" | |
| fi | |
| echo "✅ Artifacts organized successfully" | |
| echo "Final artifacts:" | |
| ls -lh artifacts/ | |
| - name: Sign update archives with Sparkle | |
| if: env.SPARKLE_PRIVATE_KEY != '' | |
| env: | |
| SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }} | |
| run: scripts/ci/sign-and-appcast.sh "${GITHUB_REF#refs/tags/v}" | |
| - name: Upload appcast artifact | |
| if: env.SPARKLE_PRIVATE_KEY != '' | |
| uses: actions/upload-artifact@v4 | |
| env: | |
| SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }} | |
| with: | |
| name: appcast-${{ github.sha }} | |
| path: appcast/appcast.xml | |
| retention-days: 90 | |
| - name: Commit appcast.xml to repo | |
| if: env.SPARKLE_PRIVATE_KEY != '' | |
| continue-on-error: true | |
| env: | |
| SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }} | |
| run: | | |
| if [ ! -f appcast/appcast.xml ]; then | |
| echo "⚠️ No appcast.xml to commit" | |
| exit 0 | |
| fi | |
| cp appcast/appcast.xml appcast.xml | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main | |
| git checkout main | |
| git add appcast.xml | |
| git diff --cached --quiet && echo "No changes to appcast.xml" && exit 0 | |
| git commit -m "Update appcast.xml for v${GITHUB_REF#refs/tags/v}" | |
| git push origin main | |
| - name: Extract release notes from CHANGELOG.md | |
| run: scripts/ci/extract-release-notes.sh "${GITHUB_REF#refs/tags/v}" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| artifacts/*.dmg | |
| artifacts/*.zip | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') || contains(github.ref, '-rc') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Notify Telegram | |
| if: success() && env.TELEGRAM_BOT_TOKEN != '' | |
| env: | |
| TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
| TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| TELEGRAM_TOPIC_ID: ${{ secrets.TELEGRAM_TOPIC_ID }} | |
| run: scripts/ci/notify-telegram.sh "${GITHUB_REF#refs/tags/v}" | |
| update-homebrew: | |
| name: Update Homebrew Tap | |
| runs-on: self-hosted | |
| needs: release | |
| if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-beta') && !contains(github.ref, '-alpha') && !contains(github.ref, '-rc') | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Update Homebrew cask formula | |
| if: env.HOMEBREW_TAP_TOKEN != '' | |
| env: | |
| HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| run: scripts/ci/update-homebrew.sh "${GITHUB_REF#refs/tags/v}" "/tmp/tablepro-artifacts-${{ github.sha }}" | |
| - name: Clean up staging directory | |
| if: always() | |
| run: rm -rf "/tmp/tablepro-artifacts-${{ github.sha }}" || true |