|
| 1 | +name: macOS build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + name: Build on macOS |
| 9 | + runs-on: macos-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v2 |
| 12 | + |
| 13 | + - name: Toolchain Cache |
| 14 | + id: mac-toolchain |
| 15 | + uses: actions/cache@v2 |
| 16 | + with: |
| 17 | + path: /usr/local |
| 18 | + key: mac-toolchain |
| 19 | + |
| 20 | + - name: Download the Source Code |
| 21 | + run: | |
| 22 | + git clone https://github.com/HandBrake/HandBrake.git |
| 23 | + cd HandBrake |
| 24 | + git submodule update --init --recursive |
| 25 | +
|
| 26 | + - name: Setup Environment |
| 27 | + if: steps.mac-toolchain.outputs.cache-hit != 'true' |
| 28 | + run: | |
| 29 | + HandBrake/scripts/mac-toolchain-build /usr/local |
| 30 | +
|
| 31 | + - name: Build HandBrake |
| 32 | + run: | |
| 33 | + cd HandBrake |
| 34 | + ./configure |
| 35 | + cd build |
| 36 | + make ub && make pkg.create |
| 37 | +
|
| 38 | + - name: Upload Assets |
| 39 | + uses: actions/upload-artifact@v2 |
| 40 | + with: |
| 41 | + name: HandBrake-macos |
| 42 | + path: ./HandBrake/build/pkg/*.dmg |
| 43 | + |
| 44 | + |
| 45 | + deploy_nightly: |
| 46 | + name: Deploy Nightly Build |
| 47 | + runs-on: ubuntu-latest |
| 48 | + needs: build |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v2 |
| 51 | + |
| 52 | + - name: Download Artifacts - Universal Binaries |
| 53 | + uses: actions/download-artifact@v2 |
| 54 | + with: |
| 55 | + name: HandBrake-macos |
| 56 | + path: mac/ |
| 57 | + |
| 58 | + # Generate Hashes |
| 59 | + - name: Generate SHA265 Hashes |
| 60 | + run: | |
| 61 | + cd mac |
| 62 | + sha256sum * > sha256.txt |
| 63 | + |
| 64 | + # Publishing the Release |
| 65 | + - name: Remove the old Release |
| 66 | + uses: dev-drprasad/delete-older-releases@v0.2.0 |
| 67 | + with: |
| 68 | + keep_latest: 0 |
| 69 | + delete_tag_pattern: "mac" |
| 70 | + env: |
| 71 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + |
| 73 | + - uses: ncipollo/release-action@v1 |
| 74 | + with: |
| 75 | + artifacts: "mac/*.*" |
| 76 | + name: "Snapshots for macOS" |
| 77 | + bodyFile: .github/workflows/mac_rel_body.md |
| 78 | + prerelease: true |
| 79 | + replacesArtifacts: false |
| 80 | + allowUpdates: false |
| 81 | + tag: mac |
| 82 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments