diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-09-10 22:41:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-10 22:41:25 +0200 |
| commit | 309ea50a7cb93a3e84098b9312b7ef94feeff8ee (patch) | |
| tree | 94b6d55c87788ab5779a7bac266382ce3c99a0ae /.github | |
| parent | 5c4f241f22314d063d5f0568ca7c450941385425 (diff) | |
| parent | fce7bcec493b4a53a101cbf41575e2a154caa902 (diff) | |
Merge pull request #4204 from A1029384756/static_builds
Changed Linux CI builds to static linking with Musl for better compatibility
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/nightly.yml | 106 |
1 files changed, 58 insertions, 48 deletions
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 62cdbd00c..6c5200c7c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -40,39 +40,46 @@ jobs: with: name: windows_artifacts path: dist - build_ubuntu: - name: Ubuntu Build + build_linux: + name: Linux Build if: github.repository == 'odin-lang/Odin' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: jirutka/setup-alpine@v1 + with: + branch: v3.20 - name: (Linux) Download LLVM run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 18 - echo "/usr/lib/llvm-18/bin" >> $GITHUB_PATH + apk add --no-cache \ + musl-dev llvm18-dev clang18 git mold lz4 \ + libxml2-static llvm18-static zlib-static zstd-static \ + make + shell: alpine.sh --root {0} - name: build odin - run: make nightly + # NOTE: this build does slow compile times because of musl + run: ci/build_linux_static.sh + shell: alpine.sh {0} - name: Odin run run: ./odin run examples/demo - name: Copy artifacts run: | - mkdir dist - cp odin dist - cp LICENSE dist - cp -r shared dist - cp -r base dist - cp -r core dist - cp -r vendor dist - cp -r examples dist - # Zipping so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38 - zip -r dist.zip dist + FILE="odin-linux-amd64-nightly+$(date -I)" + mkdir $FILE + cp odin $FILE + cp LICENSE $FILE + cp -r shared $FILE + cp -r base $FILE + cp -r core $FILE + cp -r vendor $FILE + cp -r examples $FILE + # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38 + tar -czvf dist.tar.gz $FILE - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: ubuntu_artifacts - path: dist.zip + name: linux_artifacts + path: dist.tar.gz build_macos: name: MacOS Build if: github.repository == 'odin-lang/Odin' @@ -89,24 +96,25 @@ jobs: run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly - name: Bundle run: | - mkdir dist - cp odin dist - cp LICENSE dist - cp -r shared dist - cp -r base dist - cp -r core dist - cp -r vendor dist - cp -r examples dist - dylibbundler -b -x dist/odin -d dist/libs -od -p @executable_path/libs - # Zipping so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38 - zip -r dist.zip dist + FILE="odin-macos-amd64-nightly+$(date -I)" + mkdir $FILE + cp odin $FILE + cp LICENSE $FILE + cp -r shared $FILE + cp -r base $FILE + cp -r core $FILE + cp -r vendor $FILE + cp -r examples $FILE + dylibbundler -b -x $FILE/odin -d $FILE/libs -od -p @executable_path/libs + # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38 + tar -czvf dist.tar.gz $FILE - name: Odin run run: ./dist/odin run examples/demo - name: Upload artifact uses: actions/upload-artifact@v4 with: name: macos_artifacts - path: dist.zip + path: dist.tar.gz build_macos_arm: name: MacOS ARM Build if: github.repository == 'odin-lang/Odin' @@ -123,27 +131,28 @@ jobs: run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly - name: Bundle run: | - mkdir dist - cp odin dist - cp LICENSE dist - cp -r shared dist - cp -r base dist - cp -r core dist - cp -r vendor dist - cp -r examples dist - dylibbundler -b -x dist/odin -d dist/libs -od -p @executable_path/libs - # Zipping so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38 - zip -r dist.zip dist + FILE="odin-macos-arm64-nightly+$(date -I)" + mkdir $FILE + cp odin $FILE + cp LICENSE $FILE + cp -r shared $FILE + cp -r base $FILE + cp -r core $FILE + cp -r vendor $FILE + cp -r examples $FILE + dylibbundler -b -x $FILE/odin -d $FILE/libs -od -p @executable_path/libs + # Creating a tarball so executable permissions are retained, see https://github.com/actions/upload-artifact/issues/38 + tar -czvf dist.tar.gz $FILE - name: Odin run run: ./dist/odin run examples/demo - name: Upload artifact uses: actions/upload-artifact@v4 with: name: macos_arm_artifacts - path: dist.zip + path: dist.tar.gz upload_b2: runs-on: [ubuntu-latest] - needs: [build_windows, build_macos, build_macos_arm, build_ubuntu] + needs: [build_windows, build_macos, build_macos_arm, build_linux] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v2 @@ -160,6 +169,7 @@ jobs: run: python -c "import sys; print(sys.version)" - name: Download Windows artifacts + uses: actions/download-artifact@v4.1.7 with: name: windows_artifacts @@ -167,7 +177,7 @@ jobs: - name: Download Ubuntu artifacts uses: actions/download-artifact@v4.1.7 with: - name: ubuntu_artifacts + name: linux_artifacts - name: Download macOS artifacts uses: actions/download-artifact@v4.1.7 @@ -188,8 +198,8 @@ jobs: DAYS_TO_KEEP: ${{ secrets.B2_DAYS_TO_KEEP }} run: | python3 ci/nightly.py artifact windows-amd64 windows_artifacts/ - python3 ci/nightly.py artifact ubuntu-amd64 ubuntu_artifacts/dist.zip - python3 ci/nightly.py artifact macos-amd64 macos_artifacts/dist.zip - python3 ci/nightly.py artifact macos-arm64 macos_arm_artifacts/dist.zip + python3 ci/nightly.py artifact linux-amd64 linux_artifacts/dist.tar.gz + python3 ci/nightly.py artifact macos-amd64 macos_artifacts/dist.tar.gz + python3 ci/nightly.py artifact macos-arm64 macos_arm_artifacts/dist.tar.gz python3 ci/nightly.py prune python3 ci/nightly.py json |