Skip to content

Commit

Permalink
fix: separate workflow file for each os/architecture
Browse files Browse the repository at this point in the history
this prevents commit conflicts
  • Loading branch information
mrcjkb committed Mar 1, 2024
1 parent 2b18957 commit fdf0599
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 25 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Dependencies

on: [push, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install C/C++ Compiler
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang-latest
- name: Install Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- name: Install Luarocks
uses: hishamhm/gh-actions-luarocks@master
- name: Print environment
run: |
printenv
- name: Install `luarocks-build-rust-mlua` Package
run: |
luarocks --verbose --local --lua-version=5.1 install luarocks-build-rust-mlua
luarocks --verbose pack luarocks-build-rust-mlua
- name: Install TOML Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml
luarocks --verbose pack toml
- name: Install `toml-edit` Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml-edit
luarocks --verbose pack toml-edit
- name: Regenerate Manifests and HTML
run: luarocks-admin make-manifest --lua-version=5.1 .
- name: commit-linux-x86_64
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update linux-x86_64 build artifacts"
file_pattern: "*.rock manifest* index.html"
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ on: [push, workflow_dispatch]

jobs:
build:
runs-on: ${{ matrix.os.host }}
strategy:
max-parallel: 1
matrix:
os:
- host: ubuntu-20.04
- host: macos-14
- host: macos-11
- host: windows-2019
runs-on: macos-14
needs: commit-linux-x86_64
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -21,30 +14,16 @@ jobs:
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang-latest
- name: Install MSVC Compiler Toolchain
uses: ilammy/msvc-dev-cmd@v1
- name: Install Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
if: runner.os != 'macOS'
- name: Install Rust Toolchain (macos)
uses: actions-rust-lang/setup-rust-toolchain@v1
if: runner.os == 'macOS'
with:
rustflags: "-C link-arg=-undefined -C link-arg=dynamic_lookup"
- name: Install Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- name: Install Luarocks
uses: hishamhm/gh-actions-luarocks@master
- name: Fix LUA_PATH and LUA_CPATH (Windows)
# TODO: Fix this upstream
run: |
echo "LUA_PATH=C:/Users/runneradmin/AppData/Roaming/luarocks/share/lua/5.1/?.lua:C:/Users/runneradmin/AppData/Roaming/luarocks/share/lua/5.1/?/init.lua" >> $env:GITHUB_ENV
echo "LUA_CPATH=C:/Users/runneradmin/AppData/Roaming/luarocks/lib/lua/5.1/?.dll" >> $env:GITHUB_ENV
if: runner.os == 'Windows'
- name: Print environment
run: |
printenv
Expand All @@ -60,9 +39,12 @@ jobs:
run: |
luarocks --verbose --local --lua-version=5.1 install toml-edit
luarocks --verbose pack toml-edit
- name: "[HACK] work around luarocks/#1630"
run: for f in *.macosx-x86_64.rock; do mv "$f" "$(echo "$f" | sed s/x86_64/aarch64/)"; done
- name: Regenerate Manifests and HTML
run: luarocks-admin make-manifest --lua-version=5.1 .
- uses: stefanzweifel/git-auto-commit-action@v5
- name: commit-macosx-aarch64
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update build artifacts"
commit_message: "chore: update macosx-aarch64 build artifacts"
file_pattern: "*.rock manifest* index.html"
48 changes: 48 additions & 0 deletions .github/workflows/build-macosx-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Dependencies

on: [push, workflow_dispatch]

jobs:
build:
runs-on: macos-11
needs: commit-macosx-aarch64
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install C/C++ Compiler
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang-latest
- name: Install Rust Toolchain (macos)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: "-C link-arg=-undefined -C link-arg=dynamic_lookup"
- name: Install Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- name: Install Luarocks
uses: hishamhm/gh-actions-luarocks@master
- name: Print environment
run: |
printenv
- name: Install `luarocks-build-rust-mlua` Package
run: |
luarocks --verbose --local --lua-version=5.1 install luarocks-build-rust-mlua
luarocks --verbose pack luarocks-build-rust-mlua
- name: Install TOML Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml
luarocks --verbose pack toml
- name: Install `toml-edit` Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml-edit
luarocks --verbose pack toml-edit
- name: Regenerate Manifests and HTML
run: luarocks-admin make-manifest --lua-version=5.1 .
- name: commit-macosx-x86_64
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update macosx-x86_64 build artifacts"
file_pattern: "*.rock manifest* index.html"
48 changes: 48 additions & 0 deletions .github/workflows/build-win32-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Dependencies

on: [push, workflow_dispatch]

jobs:
build:
runs-on: windows-2019
needs: commit-macosx-x86_64
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install C/C++ Compiler
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang-latest
- name: Install MSVC Compiler Toolchain
uses: ilammy/msvc-dev-cmd@v1
- name: Install Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Lua
uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- name: Install Luarocks
uses: hishamhm/gh-actions-luarocks@master
- name: Print environment
run: |
printenv
- name: Install `luarocks-build-rust-mlua` Package
run: |
luarocks --verbose --local --lua-version=5.1 install luarocks-build-rust-mlua
luarocks --verbose pack luarocks-build-rust-mlua
- name: Install TOML Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml
luarocks --verbose pack toml
- name: Install `toml-edit` Package
run: |
luarocks --verbose --local --lua-version=5.1 install toml-edit
luarocks --verbose pack toml-edit
- name: Regenerate Manifests and HTML
run: luarocks-admin make-manifest --lua-version=5.1 .
- name: commit-win32-x86_64
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update win32-x86_64 build artifacts"
file_pattern: "*.rock manifest* index.html"

0 comments on commit fdf0599

Please sign in to comment.