|
| 1 | +name: Build macOS Binaries |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - development |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - development |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: macos-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Set up Xcode |
| 21 | + uses: maxim-lobanov/setup-xcode@v1 |
| 22 | + with: |
| 23 | + xcode-version: latest-stable |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + export PIP_BREAK_SYSTEM_PACKAGES=1 |
| 28 | + brew install conan p7zip |
| 29 | + pip3 install requests |
| 30 | +
|
| 31 | + - name: Build macOS binary |
| 32 | + run: | |
| 33 | + make arcmac |
| 34 | +
|
| 35 | + - name: Download filehost-upload script |
| 36 | + run: | |
| 37 | + wget https://raw.githubusercontent.com/MEGA65/builder-docker/main/megabuild/filehost-upload |
| 38 | +
|
| 39 | + - name: Publish artifacts |
| 40 | + if: github.event_name != 'pull_request' |
| 41 | + env: |
| 42 | + FH_API_KEY: ${{ secrets.FH_API_KEY }} |
| 43 | + run: | |
| 44 | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then |
| 45 | + python3 filehost-upload -i 7d96641c-b306-49cf-80ff-ea1e5d00c9d1 -a addversion -V ${{ github.run_number }} -I "`git log -1 --pretty=tformat:'dev@%h: %s'`" m65tools-*-macos.7z |
| 46 | + elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then |
| 47 | + python3 filehost-upload -i 0dee985e-5bc1-404b-adb0-fc7989aef346 -a addversion -V ${{ github.run_number }} -I "`git log -1 --pretty=tformat:'reltemp@%h: %s'`" m65tools-*-macos.7z |
| 48 | + fi |
| 49 | +
|
| 50 | + - name: Set up deployment tag |
| 51 | + if: github.event_name != 'pull_request' |
| 52 | + run: | |
| 53 | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then |
| 54 | + echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV |
| 55 | + elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then |
| 56 | + echo "TAG_NAME=CI-development-latest" >> $GITHUB_ENV |
| 57 | + fi |
| 58 | +
|
| 59 | + - name: Deploy to GitHub Releases |
| 60 | + if: github.event_name != 'pull_request' && env.TAG_NAME != '' |
| 61 | + uses: softprops/action-gh-release@v1 |
| 62 | + with: |
| 63 | + files: m65tools-*-macos.7z |
| 64 | + tag_name: ${{ env.TAG_NAME }} |
| 65 | + prerelease: true |
| 66 | + draft: false |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments