adding MacOS section to general package build #33
Workflow file for this run
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: Build Packages for All Platforms | ||
| # TODO: | ||
| # - Mac/Arm package | ||
| # run this workflow only one at a time | ||
| concurrency: | ||
| group: build | ||
| cancel-in-progress: true | ||
| on: | ||
| # disable temporarily | ||
| push: | ||
| branches: [ "master" ] | ||
| tags: | ||
| - v1.3.0** | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
| jobs: | ||
| set-version: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.version.outputs.version }} | ||
| steps: | ||
| - name: set version by tag/branch/ref name | ||
| id: version | ||
| run: | | ||
| echo -n 'version=' >> "$GITHUB_OUTPUT" | ||
| ( ( ${{ startsWith(github.ref, 'refs/tags') }} && echo $GITHUB_REF_NAME ) || \ | ||
| ( ${{ startsWith(github.ref_name, 'v1.3.0') }} && echo $GITHUB_REF_NAME ) || \ | ||
| ( echo 'v1.3.0-'${GITHUB_SHA:0:8} ) ) >> "$GITHUB_OUTPUT" | ||
| build: | ||
| needs: set-version | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| release: | ||
| - file: release-linux-x86_64 | ||
| name: Linux-x64 | ||
| runs-on: ubuntu-latest | ||
| container: debian:oldstable-slim | ||
| - file: release-mingw32-x86_64 | ||
| name: Windows-x32 | ||
| runs-on: ubuntu-latest | ||
| container: debian:oldstable-slim | ||
| platform: mingw32 | ||
| - file: release-darwin-x86_64 | ||
| name: Mac-arm64 | ||
| runs-on: macos-15 | ||
| runs-on: ${{ matrix.release.runs-on }} | ||
| container: | ||
| image: ${{ matrix.release.container }} | ||
| if: ${{ matrix.release.container }} | ||
| env: | ||
| VERSION: ${{ needs.set-version.outputs.version }} | ||
| steps: | ||
| - name: dependencies | ||
| run: | | ||
| apt update -y | ||
| apt install -y -qq \ | ||
| make \ | ||
| build-essential \ | ||
| libgl1-mesa-dev \ | ||
| mingw-w64 \ | ||
| libsdl2-dev \ | ||
| libopenal-dev \ | ||
| libfreetype6-dev \ | ||
| zip \ | ||
| libcurl4-openssl-dev \ | ||
| curl \ | ||
| rsync \ | ||
| git | ||
| if: ${{ matrix.release.runs-on != 'macos-15' }} | ||
| - uses: actions/checkout@v6 | ||
| ## attempts for setting version via tag, but doesn't work for shallow copy: | ||
| # with: | ||
| # fetch-tags: true | ||
| #- name: Git unsafe | ||
| # run: git config --global --add safe.directory /__w/tremulous/tremulous | ||
| - name: platform | ||
| if: ${{ matrix.release.platform }} | ||
| run: echo "PLATFORM="${{ matrix.release.PLATFORM }} >> $GITHUB_ENV | ||
| - name: make | ||
| run: USE_RESTCLIENT=1 USE_INTERNAL_LUA=1 USE_CURL_DLOPEN=0 make -j | ||
| - name: extract pak | ||
| shell: bash | ||
| run: | | ||
| PKG=tremulous-$VERSION-${{ matrix.release.name }} | ||
| echo "PKG="$PKG >> $GITHUB_ENV | ||
| mkdir ./build/$PKG | ||
| pushd ./build/$PKG | ||
| unzip ../${{ matrix.release.file }}.zip | ||
| - name: change perms | ||
| run: chmod -R ugo+rw build | ||
| - name: repack and upload archives | ||
| # only run if this was a tagged release (only works if separate job) | ||
| # if: ( github.event_name == "create" ) && ( github.event.ref_type == 'tag' ) | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ env.PKG }} | ||
| # use globbing to include subdir in zip | ||
| path: ./build/${{ env.PKG }}* | ||