From fdf0599aa68c015c9fc5ca16d859b46f171b07a0 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 1 Mar 2024 21:14:31 +0100 Subject: [PATCH] fix: separate workflow file for each os/architecture this prevents commit conflicts --- .github/workflows/build-linux-x86_64.yml | 45 +++++++++++++++++ .../{build.yml => build-macosx-aarch64.yml} | 32 +++---------- .github/workflows/build-macosx-x86_64.yml | 48 +++++++++++++++++++ .github/workflows/build-win32-x86_64.yml | 48 +++++++++++++++++++ 4 files changed, 148 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build-linux-x86_64.yml rename .github/workflows/{build.yml => build-macosx-aarch64.yml} (57%) create mode 100644 .github/workflows/build-macosx-x86_64.yml create mode 100644 .github/workflows/build-win32-x86_64.yml diff --git a/.github/workflows/build-linux-x86_64.yml b/.github/workflows/build-linux-x86_64.yml new file mode 100644 index 000000000..9b124e06a --- /dev/null +++ b/.github/workflows/build-linux-x86_64.yml @@ -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" diff --git a/.github/workflows/build.yml b/.github/workflows/build-macosx-aarch64.yml similarity index 57% rename from .github/workflows/build.yml rename to .github/workflows/build-macosx-aarch64.yml index 4558cac41..f7c4991e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-macosx-aarch64.yml @@ -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: @@ -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 @@ -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" diff --git a/.github/workflows/build-macosx-x86_64.yml b/.github/workflows/build-macosx-x86_64.yml new file mode 100644 index 000000000..c9ca52dbb --- /dev/null +++ b/.github/workflows/build-macosx-x86_64.yml @@ -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" diff --git a/.github/workflows/build-win32-x86_64.yml b/.github/workflows/build-win32-x86_64.yml new file mode 100644 index 000000000..2fee7da1a --- /dev/null +++ b/.github/workflows/build-win32-x86_64.yml @@ -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"