|
| 1 | +name: Release Assets |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + linux-bundle: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Check out repository |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Install Rust toolchain |
| 21 | + uses: dtolnay/rust-toolchain@stable |
| 22 | + |
| 23 | + - name: Cache Rust artifacts |
| 24 | + uses: Swatinem/rust-cache@v2 |
| 25 | + |
| 26 | + - name: Install Linux bundle tools |
| 27 | + run: | |
| 28 | + sudo apt-get update |
| 29 | + sudo apt-get install -y zig xvfb libgtk-4-dev libadwaita-1-dev |
| 30 | +
|
| 31 | + - name: Build Linux bundle |
| 32 | + run: bash scripts/build_linux_bundle.sh |
| 33 | + |
| 34 | + - name: Run Linux smoke checks |
| 35 | + run: | |
| 36 | + bash scripts/smoke_taskers_ui.sh |
| 37 | + bash scripts/smoke_taskers_focus_churn.sh |
| 38 | + bash scripts/smoke_linux_release_launcher.sh |
| 39 | +
|
| 40 | + - name: Upload Linux bundle |
| 41 | + uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: linux-bundle |
| 44 | + path: dist/taskers-linux-bundle-v*.tar.xz |
| 45 | + |
| 46 | + macos-universal-dmg: |
| 47 | + runs-on: macos-15 |
| 48 | + env: |
| 49 | + TASKERS_MACOS_CERTIFICATE_P12_BASE64: ${{ secrets.TASKERS_MACOS_CERTIFICATE_P12_BASE64 }} |
| 50 | + TASKERS_MACOS_CERTIFICATE_PASSWORD: ${{ secrets.TASKERS_MACOS_CERTIFICATE_PASSWORD }} |
| 51 | + TASKERS_MACOS_CODESIGN_IDENTITY: ${{ secrets.TASKERS_MACOS_CODESIGN_IDENTITY }} |
| 52 | + TASKERS_MACOS_NOTARY_APPLE_ID: ${{ secrets.TASKERS_MACOS_NOTARY_APPLE_ID }} |
| 53 | + TASKERS_MACOS_NOTARY_TEAM_ID: ${{ secrets.TASKERS_MACOS_NOTARY_TEAM_ID }} |
| 54 | + TASKERS_MACOS_NOTARY_PASSWORD: ${{ secrets.TASKERS_MACOS_NOTARY_PASSWORD }} |
| 55 | + |
| 56 | + steps: |
| 57 | + - name: Check out repository |
| 58 | + uses: actions/checkout@v4 |
| 59 | + |
| 60 | + - name: Install Rust toolchain |
| 61 | + uses: dtolnay/rust-toolchain@stable |
| 62 | + |
| 63 | + - name: Cache Rust artifacts |
| 64 | + uses: Swatinem/rust-cache@v2 |
| 65 | + |
| 66 | + - name: Install macOS build tools |
| 67 | + run: | |
| 68 | + brew update |
| 69 | + brew install xcodegen zig |
| 70 | +
|
| 71 | + - name: Validate macOS release credentials |
| 72 | + run: | |
| 73 | + missing=0 |
| 74 | + for name in \ |
| 75 | + TASKERS_MACOS_CERTIFICATE_P12_BASE64 \ |
| 76 | + TASKERS_MACOS_CERTIFICATE_PASSWORD \ |
| 77 | + TASKERS_MACOS_CODESIGN_IDENTITY \ |
| 78 | + TASKERS_MACOS_NOTARY_APPLE_ID \ |
| 79 | + TASKERS_MACOS_NOTARY_TEAM_ID \ |
| 80 | + TASKERS_MACOS_NOTARY_PASSWORD; do |
| 81 | + if [[ -z "${!name:-}" ]]; then |
| 82 | + echo "::error::Missing required secret ${name}" |
| 83 | + missing=1 |
| 84 | + fi |
| 85 | + done |
| 86 | +
|
| 87 | + if [[ $missing -ne 0 ]]; then |
| 88 | + exit 1 |
| 89 | + fi |
| 90 | +
|
| 91 | + - name: Install Developer ID certificate |
| 92 | + run: bash scripts/install_macos_codesign_certificate.sh |
| 93 | + |
| 94 | + - name: Generate Xcode project |
| 95 | + run: bash scripts/generate_macos_project.sh |
| 96 | + |
| 97 | + - name: Build universal Taskers.app |
| 98 | + run: | |
| 99 | + xcodebuild build \ |
| 100 | + -project macos/Taskers.xcodeproj \ |
| 101 | + -scheme TaskersMac \ |
| 102 | + -configuration Release \ |
| 103 | + -derivedDataPath build/macos/DerivedData \ |
| 104 | + ARCHS="arm64 x86_64" \ |
| 105 | + ONLY_ACTIVE_ARCH=NO \ |
| 106 | + CODE_SIGNING_ALLOWED=NO \ |
| 107 | + CODE_SIGNING_REQUIRED=NO |
| 108 | +
|
| 109 | + - name: Sign universal Taskers.app |
| 110 | + run: bash scripts/sign_macos_app.sh |
| 111 | + |
| 112 | + - name: Build universal DMG |
| 113 | + run: bash scripts/build_macos_dmg.sh |
| 114 | + |
| 115 | + - name: Notarize and staple universal DMG |
| 116 | + run: | |
| 117 | + version="$(sed -n 's/^version = \"\\(.*\\)\"/\\1/p' Cargo.toml | head -n1)" |
| 118 | + bash scripts/notarize_macos_dmg.sh "dist/Taskers-v${version}-universal2.dmg" |
| 119 | +
|
| 120 | + - name: Upload universal DMG |
| 121 | + uses: actions/upload-artifact@v4 |
| 122 | + with: |
| 123 | + name: macos-universal-dmg |
| 124 | + path: dist/Taskers-v*-universal2.dmg |
| 125 | + |
| 126 | + release-manifest: |
| 127 | + needs: |
| 128 | + - linux-bundle |
| 129 | + runs-on: ubuntu-latest |
| 130 | + |
| 131 | + steps: |
| 132 | + - name: Check out repository |
| 133 | + uses: actions/checkout@v4 |
| 134 | + |
| 135 | + - name: Download built assets |
| 136 | + uses: actions/download-artifact@v4 |
| 137 | + with: |
| 138 | + path: dist |
| 139 | + |
| 140 | + - name: Flatten downloaded artifacts |
| 141 | + run: | |
| 142 | + mkdir -p dist/release |
| 143 | + find dist -type f -exec cp {} dist/release/ \; |
| 144 | +
|
| 145 | + - name: Build release manifest |
| 146 | + run: python3 scripts/build_release_manifest.py --dist-dir dist/release |
| 147 | + |
| 148 | + - name: Upload release manifest |
| 149 | + uses: actions/upload-artifact@v4 |
| 150 | + with: |
| 151 | + name: release-manifest |
| 152 | + path: dist/release/taskers-manifest-v*.json |
| 153 | + |
| 154 | + upload-github-release: |
| 155 | + if: startsWith(github.ref, 'refs/tags/v') |
| 156 | + needs: |
| 157 | + - release-manifest |
| 158 | + - macos-universal-dmg |
| 159 | + runs-on: ubuntu-latest |
| 160 | + |
| 161 | + steps: |
| 162 | + - name: Download built assets |
| 163 | + uses: actions/download-artifact@v4 |
| 164 | + with: |
| 165 | + path: dist |
| 166 | + |
| 167 | + - name: Flatten downloaded artifacts |
| 168 | + run: | |
| 169 | + mkdir -p dist/release |
| 170 | + find dist -type f -exec cp {} dist/release/ \; |
| 171 | +
|
| 172 | + - name: Create draft GitHub release with assets |
| 173 | + uses: softprops/action-gh-release@v2 |
| 174 | + with: |
| 175 | + draft: true |
| 176 | + files: | |
| 177 | + dist/release/taskers-manifest-v*.json |
| 178 | + dist/release/taskers-linux-bundle-v*.tar.xz |
| 179 | + dist/release/Taskers-v*-universal2.dmg |
0 commit comments