#develop fixed typos #185
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: π Develop | |
| on: | |
| push: | |
| branches: [develop] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| name: π CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Run CI | |
| uses: ./.github/actions/ci | |
| with: | |
| app: desktop | |
| check-deploy: | |
| name: π Check Deploy Marker | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| outputs: | |
| should-deploy: ${{ steps.check.outputs.should-deploy }} | |
| steps: | |
| - name: Check deploy trigger | |
| id: check | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| echo "should-deploy=true" >> $GITHUB_OUTPUT | |
| echo "β Manual trigger (workflow_dispatch)" | |
| else | |
| COMMIT_MSG="${{ github.event.head_commit.message }}" | |
| if [[ "$COMMIT_MSG" == *"#patch"* ]] || [[ "$COMMIT_MSG" == *"#deploy"* ]]; then | |
| echo "should-deploy=true" >> $GITHUB_OUTPUT | |
| echo "β Deploy marker found in commit message" | |
| else | |
| echo "should-deploy=false" >> $GITHUB_OUTPUT | |
| echo "βοΈ No deploy marker found, skipping deployment" | |
| fi | |
| fi | |
| version-bump: | |
| name: π¦ Version Bump | |
| runs-on: ubuntu-latest | |
| needs: check-deploy | |
| if: needs.check-deploy.outputs.should-deploy == 'true' | |
| outputs: | |
| version: ${{ steps.bump.outputs.version }} | |
| tag: ${{ steps.bump.outputs.tag }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Bump version | |
| id: bump | |
| uses: ./.github/actions/version-bump | |
| with: | |
| app: desktop | |
| app-directory: apps/desktop | |
| build: | |
| name: π¦ Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.platform }} | |
| needs: version-bump | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| target: aarch64-apple-darwin | |
| args: '--target aarch64-apple-darwin' | |
| - platform: macos-latest | |
| target: x86_64-apple-darwin | |
| args: '--target x86_64-apple-darwin' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: develop | |
| fetch-depth: 0 | |
| - name: Pull latest changes | |
| run: git pull origin develop | |
| - name: Build Tauri app | |
| uses: ./.github/actions/build-tauri | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| app: desktop | |
| app-directory: apps/desktop | |
| platform: ${{ matrix.platform }} | |
| target: ${{ matrix.target }} | |
| args: ${{ matrix.args }} | |
| config: prod | |
| - name: Determine arch suffix | |
| id: arch | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then | |
| echo "suffix=aarch64" >> $GITHUB_OUTPUT | |
| elif [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then | |
| echo "suffix=x64" >> $GITHUB_OUTPUT | |
| else | |
| echo "suffix=${{ matrix.target }}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Rename updater artifacts with arch suffix | |
| shell: bash | |
| run: | | |
| BUNDLE_DIR="target/${{ matrix.target }}/release/bundle/macos" | |
| if [ -f "$BUNDLE_DIR/Focuscat.app.tar.gz" ]; then | |
| cp "$BUNDLE_DIR/Focuscat.app.tar.gz" "$BUNDLE_DIR/Focuscat_${{ steps.arch.outputs.suffix }}.app.tar.gz" | |
| fi | |
| if [ -f "$BUNDLE_DIR/Focuscat.app.tar.gz.sig" ]; then | |
| cp "$BUNDLE_DIR/Focuscat.app.tar.gz.sig" "$BUNDLE_DIR/Focuscat_${{ steps.arch.outputs.suffix }}.app.tar.gz.sig" | |
| fi | |
| - name: Stage release files | |
| shell: bash | |
| run: | | |
| mkdir -p release-bundle | |
| cp target/${{ matrix.target }}/release/bundle/dmg/*.dmg release-bundle/ | |
| cp target/${{ matrix.target }}/release/bundle/macos/Focuscat_${{ steps.arch.outputs.suffix }}.app.tar.gz release-bundle/ | |
| cp target/${{ matrix.target }}/release/bundle/macos/Focuscat_${{ steps.arch.outputs.suffix }}.app.tar.gz.sig release-bundle/ | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-${{ steps.arch.outputs.suffix }} | |
| path: release-bundle/ | |
| upload-to-release: | |
| name: π€ Upload to release | |
| runs-on: ubuntu-latest | |
| needs: [version-bump, build] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download release artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: release-* | |
| path: release-artifacts | |
| merge-multiple: true | |
| - name: Create release and upload assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.version-bump.outputs.tag }} | |
| name: Focuscat v${{ needs.version-bump.outputs.version }} | |
| body: | | |
| ## Focuscat v${{ needs.version-bump.outputs.version }} | |
| ${{ github.event_name == 'workflow_dispatch' && 'Manual release from Actions.' || 'Auto-deployed from develop branch.' }} | |
| ### Changes | |
| ${{ github.event_name == 'workflow_dispatch' && 'Triggered via workflow_dispatch.' || github.event.head_commit.message }} | |
| draft: false | |
| prerelease: true | |
| files: release-artifacts/* | |
| fail_on_unmatched_files: false | |
| overwrite_files: true | |
| updater-json: | |
| name: π Generate Updater JSON | |
| runs-on: ubuntu-latest | |
| needs: [version-bump, upload-to-release] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Generate latest.json | |
| shell: bash | |
| env: | |
| VERSION: ${{ needs.version-bump.outputs.version }} | |
| TAG: ${{ needs.version-bump.outputs.tag }} | |
| run: | | |
| REPO="builder-group/focuscat" | |
| BASE_URL="https://github.com/${REPO}/releases/download/${TAG}" | |
| # Download signature files from the release (retry up to 3 times with delay) | |
| for arch in aarch64 x64; do | |
| for attempt in 1 2 3; do | |
| if curl -sfL "${BASE_URL}/Focuscat_${arch}.app.tar.gz.sig" -o "sig_${arch}.txt"; then | |
| echo "β Downloaded sig for ${arch}" | |
| break | |
| fi | |
| echo "β³ Attempt ${attempt}/3 failed for ${arch} sig, retrying in 10s..." | |
| sleep 10 | |
| done | |
| done | |
| SIG_AARCH64=$(cat sig_aarch64.txt 2>/dev/null || echo "") | |
| SIG_X64=$(cat sig_x64.txt 2>/dev/null || echo "") | |
| PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| printf '{"version":"%s","pub_date":"%s","platforms":{"darwin-aarch64":{"signature":"%s","url":"%s"},"darwin-x86_64":{"signature":"%s","url":"%s"}}}' \ | |
| "${VERSION}" \ | |
| "${PUB_DATE}" \ | |
| "${SIG_AARCH64}" \ | |
| "${BASE_URL}/Focuscat_aarch64.app.tar.gz" \ | |
| "${SIG_X64}" \ | |
| "${BASE_URL}/Focuscat_x64.app.tar.gz" \ | |
| > latest.json | |
| - name: Upload latest.json to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.version-bump.outputs.tag }} | |
| files: latest.json | |
| fail_on_unmatched_files: false |