ci: use macos-latest instead of macos-10.15 #11
This file contains 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: Continuous Integration | |
on: | |
push: | |
paths: | |
- "**.c" | |
- "**.h" | |
- "**.cpp" | |
- "**.hpp" | |
- "**.build" | |
- "**.in" | |
- "**.yml" | |
pull_request: | |
paths: | |
- "**.c" | |
- "**.h" | |
- "**.cpp" | |
- "**.hpp" | |
- "**.build" | |
- "**.in" | |
- "**.yml" | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- run: sudo apt-get update | |
- run: sudo apt-get install build-essential | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip | |
restore-keys: | | |
${{ runner.os }}-pip | |
- run: python -m pip install --upgrade meson ninja | |
- run: meson setup build/ | |
- run: meson compile -C build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spc2it-ubuntu | |
path: build/spc2it | |
build-win32: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- run: sudo apt-get update | |
- run: sudo apt-get install build-essential mingw-w64 | |
- run: sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix | |
- run: sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip | |
restore-keys: | | |
${{ runner.os }}-pip | |
- run: python -m pip install --upgrade meson ninja | |
- run: meson setup build/ --cross-file ./external/meson_toolchains/mingw32_meson.ini | |
- run: meson compile -C build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spc2it-win32 | |
path: build/spc2it.exe | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip | |
restore-keys: | | |
${{ runner.os }}-pip | |
- run: python -m pip install --upgrade meson ninja | |
- run: meson setup build/ | |
- run: meson compile -C build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spc2it-macos | |
path: build/spc2it | |
create-release: | |
needs: [build-ubuntu, build-win32, build-macos] | |
runs-on: ubuntu-20.04 | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' | |
steps: | |
- name: Download ubuntu artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: spc2it-ubuntu | |
- name: Download win32 artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: spc2it-win32 | |
- name: Download macos artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: spc2it-macos | |
- name: Prepare artifacts for release | |
run: | | |
7z a -tzip spc2it-ubuntu.zip spc2it-ubuntu/* | |
7z a -tzip spc2it-win32.zip spc2it-win32/* | |
7z a -tzip spc2it-macos.zip spc2it-macos/* | |
- name: Create prerelease | |
if: github.ref == 'refs/heads/master' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
automatic_release_tag: "latest" | |
title: "Latest development builds" | |
files: | | |
spc2it-ubuntu.zip | |
spc2it-win32.zip | |
spc2it-macos.zip | |
- name: Create release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: "${{ contains(github.ref, '-rc') }}" | |
files: | | |
spc2it-ubuntu.zip | |
spc2it-win32.zip | |
spc2it-macos.zip |