Skip to content

Commit

Permalink
Seperate os names from the actual runner (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
hensldm authored Sep 10, 2023
1 parent 48b3c00 commit 461f6b5
Showing 1 changed file with 32 additions and 19 deletions.
51 changes: 32 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,74 @@ on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os.runner }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
os: [
{
name: linux,
runner: ubuntu-20.04
},
{
name: macos,
runner: macos-latest
},
{
name: windows,
runner: windows-latest
}
]
ido: [5.3, 7.1]

name: Recompiling ido ${{ matrix.ido }} for ${{ matrix.os }}
name: Recompiling ido ${{ matrix.ido }} for ${{ matrix.os.name }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Ubuntu
- name: Install dependencies (Ubuntu)
- name: Install dependencies (Linux)
shell: bash
if: matrix.os == 'ubuntu-20.04'
if: matrix.os.name == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Build recomp binary (Ubuntu)
- name: Build recomp binary (Linux)
shell: bash
if: matrix.os == 'ubuntu-20.04'
if: matrix.os.name == 'linux'
run: |
make -j $(nproc) RELEASE=1 setup
- name: Run the build script (Ubuntu)
- name: Run the build script (Linux)
shell: bash
if: matrix.os == 'ubuntu-20.04'
if: matrix.os.name == 'linux'
run: |
make -j $(nproc) RELEASE=1 VERSION=${{ matrix.ido }}
# MacOS
- name: Install dependencies (MacOS)
shell: bash
if: matrix.os == 'macos-latest'
if: matrix.os.name == 'macos'
run: |
brew install make
- name: Build recomp binary (MacOS)
shell: bash
if: matrix.os == 'macos-latest'
if: matrix.os.name == 'macos'
run: |
make -j $(nproc) RELEASE=1 setup
- name: Run the build script (MacOS)
shell: bash
if: matrix.os == 'macos-latest'
if: matrix.os.name == 'macos'
run: |
make -j $(nproc) RELEASE=1 VERSION=${{ matrix.ido }} TARGET=universal
# Windows
- name: Install dependencies (Windows)
uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
if: matrix.os.name == 'windows'
with:
install: |-
gcc
Expand All @@ -67,13 +80,13 @@ jobs:
- name: Build recomp binary (Windows)
shell: msys2 {0}
if: matrix.os == 'windows-latest'
if: matrix.os.name == 'windows'
run: |-
make --jobs RELEASE=1 setup
- name: Run the build script (Windows)
shell: cmd
if: matrix.os == 'windows-latest'
if: matrix.os.name == 'windows'
run: |-
set MSYSTEM=MSYS
msys2 -c 'make --jobs RELEASE=1 VERSION=${{ matrix.ido }}'
Expand All @@ -83,18 +96,18 @@ jobs:
shell: bash
run: |
cd build/${{ matrix.ido }}/out
tar -czvf ../../../ido-${{ matrix.ido }}-recomp-${{ matrix.os }}.tar.gz *
tar -czvf ../../../ido-${{ matrix.ido }}-recomp-${{ matrix.os.name }}.tar.gz *
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: ido-${{ matrix.ido }}-recomp-${{ matrix.os }}
name: ido-${{ matrix.ido }}-recomp-${{ matrix.os.name }}
path: |
ido-${{ matrix.ido }}-recomp-${{ matrix.os }}.tar.gz
ido-${{ matrix.ido }}-recomp-${{ matrix.os.name }}.tar.gz
- name: Publish release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
ido-${{ matrix.ido }}-recomp-${{ matrix.os }}.tar.gz
ido-${{ matrix.ido }}-recomp-${{ matrix.os.name }}.tar.gz

0 comments on commit 461f6b5

Please sign in to comment.