|
32 | 32 | - run: rustup target add wasm32-unknown-unknown |
33 | 33 | - uses: jetli/trunk-action@v0.5.0 |
34 | 34 | with: |
35 | | - version: 'latest' |
| 35 | + version: "latest" |
36 | 36 |
|
37 | 37 | - uses: actions/cache/restore@v4 |
38 | 38 | with: |
|
54 | 54 | name: frontend-build-${{ github.ref_name }} |
55 | 55 | path: frontend/dist |
56 | 56 |
|
57 | | - build: |
| 57 | + build-linux: |
58 | 58 | name: Binaries for ${{ matrix.name }} |
59 | 59 | needs: frontend |
60 | 60 | runs-on: ubuntu-24.04 |
@@ -141,9 +141,61 @@ jobs: |
141 | 141 | name: ${{ matrix.platform }}-build-${{ github.ref_name }} |
142 | 142 | path: bin/${{ matrix.platform }} |
143 | 143 |
|
| 144 | + build-macos: |
| 145 | + name: Binaries for ${{ matrix.name }} |
| 146 | + needs: frontend |
| 147 | + runs-on: ${{ matrix.os }} |
| 148 | + |
| 149 | + strategy: |
| 150 | + matrix: |
| 151 | + include: |
| 152 | + - name: aarch64-apple-darwin |
| 153 | + target: aarch64-apple-darwin |
| 154 | + os: macos-14 |
| 155 | + |
| 156 | + steps: |
| 157 | + - uses: actions/checkout@v4 |
| 158 | + - run: rustup toolchain install stable --profile minimal |
| 159 | + - run: rustup target add ${{ matrix.target }} |
| 160 | + |
| 161 | + - uses: actions/download-artifact@v4 |
| 162 | + with: |
| 163 | + name: frontend-build-${{ github.ref_name }} |
| 164 | + path: frontend/dist |
| 165 | + |
| 166 | + - uses: actions/cache/restore@v4 |
| 167 | + with: |
| 168 | + path: | |
| 169 | + ~/.cargo/bin/ |
| 170 | + ~/.cargo/registry/index/ |
| 171 | + ~/.cargo/registry/cache/ |
| 172 | + ~/.cargo/git/db/ |
| 173 | + backend/target/ |
| 174 | + key: backend-${{ matrix.name }}-${{ hashFiles('backend/Cargo.toml') }} |
| 175 | + restore-keys: backend-${{ matrix.name }}- |
| 176 | + |
| 177 | + - name: Build |
| 178 | + run: cargo build --release --locked --target ${{ matrix.target }} --manifest-path backend/Cargo.toml |
| 179 | + |
| 180 | + - name: Copy binaries |
| 181 | + shell: bash |
| 182 | + run: | |
| 183 | + mkdir -p bin |
| 184 | + src="backend/target/${{ matrix.target }}/release/mailcrab-backend" |
| 185 | + dst="bin/mailcrab-${{ matrix.name }}-${{ github.ref_name }}" |
| 186 | + cp "$src" "$dst" |
| 187 | + shasum -a 256 -b "$dst" > "$dst.sha256" |
| 188 | +
|
| 189 | + - uses: softprops/action-gh-release@v1 |
| 190 | + with: |
| 191 | + draft: true |
| 192 | + files: bin/mailcrab-* |
| 193 | + env: |
| 194 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 195 | + |
144 | 196 | release: |
145 | 197 | name: Release |
146 | | - needs: build |
| 198 | + needs: [build-linux, build-macos] |
147 | 199 | runs-on: ubuntu-24.04 |
148 | 200 |
|
149 | 201 | steps: |
|
0 commit comments