From 8c0a8232071f1a1461795a040f6e2455e21b8a4d Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Mon, 29 Jan 2024 23:01:21 +0100 Subject: arm64 builds --- .github/workflows/nightly.yml | 30 ++++++++++++++++++++++++++++++ build.sh | 20 +++++++++++++++----- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8c789a5..4811f01 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -7,6 +7,36 @@ on: #- cron: 0 20 * * * jobs: + dist-arm64-darwin: + runs-on: macos-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v1 + - name: Download LLVM and setup PATH + run: | + brew install llvm@14 + echo "/usr/local/opt/llvm@14/bin" >> $GITHUB_PATH + TMP_PATH=$(xcrun --show-sdk-path)/user/include + echo "CPATH=$TMP_PATH" >> $GITHUB_ENV + - name: Download Odin + run: | + git clone https://github.com/odin-lang/Odin + - name: Build Odin + run: | + cd Odin + make release + - name: Build ols + run: ./build.sh CI -target:darwin_arm64 -extra-linker-flags:"--target=arm64-apple-macos" + - name: Move to Dist + run: | + mkdir dist + mv ols dist/ols-arm64-darwin + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: dist-arm64-darwin + path: ./dist + dist-x86_64-darwin: runs-on: macos-latest timeout-minutes: 15 diff --git a/build.sh b/build.sh index 8845ed6..c0c899c 100755 --- a/build.sh +++ b/build.sh @@ -3,11 +3,13 @@ if [[ $1 == "CI" ]] then + shift + export PATH=$PATH:$PWD/Odin #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - odin test ../tests -collection:shared=../src -o:speed + odin test ../tests -collection:shared=../src -o:speed $@ if ([ $? -ne 0 ]) then @@ -28,10 +30,14 @@ then fi if [[ $1 == "single_test" ]] then + shift + #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - odin test ../tests -collection:shared=../src -test-name:$2 + odin test ../tests -collection:shared=../src -test-name:$@ + + shift if ([ $? -ne 0 ]) then @@ -44,10 +50,12 @@ fi if [[ $1 == "test" ]] then + shift + #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - odin test ../tests -collection:shared=../src + odin test ../tests -collection:shared=../src $@ if ([ $? -ne 0 ]) then @@ -59,9 +67,11 @@ then fi if [[ $1 == "debug" ]] then - odin build src/ -collection:shared=src -out:ols -use-separate-modules -debug + shift + + odin build src/ -collection:shared=src -out:ols -use-separate-modules -debug $@ exit 0 fi -odin build src/ -collection:shared=src -out:ols -o:speed +odin build src/ -collection:shared=src -out:ols -o:speed $@ -- cgit v1.2.3 From d5f5bc5ba6d6ce48305073e0cd3ff2916989b034 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Mon, 29 Jan 2024 23:09:12 +0100 Subject: don't run tests when cross-compiling --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4811f01..e5e204b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -26,7 +26,7 @@ jobs: cd Odin make release - name: Build ols - run: ./build.sh CI -target:darwin_arm64 -extra-linker-flags:"--target=arm64-apple-macos" + run: ./build.sh -target:darwin_arm64 -extra-linker-flags:"--target=arm64-apple-macos" - name: Move to Dist run: | mkdir dist -- cgit v1.2.3 From a95a326cbce6a5a7e925b57d36efb5faa9bf2d51 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Mon, 29 Jan 2024 23:14:58 +0100 Subject: set correct path --- .github/workflows/nightly.yml | 2 +- build.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e5e204b..be67d25 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -26,7 +26,7 @@ jobs: cd Odin make release - name: Build ols - run: ./build.sh -target:darwin_arm64 -extra-linker-flags:"--target=arm64-apple-macos" + run: ./build.sh CI_NO_TESTS -target:darwin_arm64 -extra-linker-flags:"--target=arm64-apple-macos" - name: Move to Dist run: | mkdir dist diff --git a/build.sh b/build.sh index c0c899c..e1f00a5 100755 --- a/build.sh +++ b/build.sh @@ -28,6 +28,12 @@ then #exit 1 fi fi +if [[ $1 == "CI_NO_TESTS" ]] +then + shift + + export PATH=$PATH:$PWD/Odin +fi if [[ $1 == "single_test" ]] then shift -- cgit v1.2.3 From 7120a60eea8f481d638ed945f1a4f2739f1839cd Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Mon, 29 Jan 2024 23:25:32 +0100 Subject: add arm to publish step --- .github/workflows/nightly.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index be67d25..8d5a3bd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -128,7 +128,7 @@ jobs: name: publish runs-on: ubuntu-latest timeout-minutes: 30 - needs: ['dist-x86_64-pc-windows-msvc', 'dist-x86_64-unknown-linux-gnu', 'dist-x86_64-darwin'] + needs: ['dist-x86_64-pc-windows-msvc', 'dist-x86_64-unknown-linux-gnu', 'dist-x86_64-darwin', 'dist-arm64-darwin'] steps: - name: Install Nodejs uses: actions/setup-node@v1 @@ -154,14 +154,24 @@ jobs: with: name: dist-x86_64-darwin path: dist + - uses: actions/download-artifact@v2 + with: + name: dist-arm64-darwin + path: dist - run: | ls -al ./dist cd dist zip -r ols-x86_64-pc-windows-msvc.zip ols-x86_64-pc-windows-msvc.exe builtin + chmod +x ols-x86_64-unknown-linux-gnu zip -r ols-x86_64-unknown-linux-gnu.zip ols-x86_64-unknown-linux-gnu builtin + chmod +x ols-x86_64-darwin zip -r ols-x86_64-darwin.zip ols-x86_64-darwin builtin + + chmod +x ols-arm64-darwin + zip -r ols-arm64-darwin.zip ols-arm64-darwin builtin + rm -rf builtin - name: Publish Release uses: ./.github/actions/github-release -- cgit v1.2.3 From 676809ffbdb2896f703e7b84cc19f9fd0ef2a0e2 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Mon, 29 Jan 2024 23:33:31 +0100 Subject: fix spacing --- build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index e1f00a5..c5e78f5 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ if [[ $1 == "CI" ]] then - shift + shift export PATH=$PATH:$PWD/Odin #BUG in odin test, it makes the executable with the same name as a folder and gets confused. @@ -30,20 +30,20 @@ then fi if [[ $1 == "CI_NO_TESTS" ]] then - shift + shift export PATH=$PATH:$PWD/Odin fi if [[ $1 == "single_test" ]] then - shift + shift #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests odin test ../tests -collection:shared=../src -test-name:$@ - shift + shift if ([ $? -ne 0 ]) then @@ -56,7 +56,7 @@ fi if [[ $1 == "test" ]] then - shift + shift #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests @@ -73,7 +73,7 @@ then fi if [[ $1 == "debug" ]] then - shift + shift odin build src/ -collection:shared=src -out:ols -use-separate-modules -debug $@ exit 0 -- cgit v1.2.3