ondk build #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ondk build | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
linux: | |
name: Build for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Build toolchain | |
run: ./build.sh | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
name: ondk-linux | |
path: dist/*.tar.xz | |
- name: Upload release assets | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
files: dist/*.tar.xz | |
windows: | |
name: Build for Windows | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Setup MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
update: true | |
install: make diffutils tar patch unzip gzip | |
pacboy: 7zip:p python:p cmake:p gcc:p ninja:p | |
- name: Build toolchain | |
run: | | |
cp -r $GITHUB_WORKSPACE /c/ondk | |
cd /c/ondk | |
bash build-windows.sh | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
name: ondk-windows | |
path: C:\ondk\dist\*.tar.xz | |
- name: Upload release assets | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
files: C:/ondk/dist/*.tar.xz | |
macos-x64: | |
name: Build for macOS (x64) | |
runs-on: macos-13 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Build toolchain | |
env: | |
SKIP_DIST: 1 | |
run: | | |
./build.sh x86_64 | |
mkdir tmp | |
tar c rust/build | xz --x86 --lzma2 > tmp/build.tar.xz | |
tar c out | xz --x86 --lzma2 > tmp/out.tar.xz | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-x64 | |
path: tmp/*.tar.xz | |
macos-arm64: | |
name: Build for macOS (arm64) | |
runs-on: macos-13 | |
needs: macos-x64 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Download x64 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-x64 | |
path: tmp | |
- name: Build toolchain | |
env: | |
SKIP_DIST: 1 | |
run: ./build.sh aarch64 | |
- name: Build ONDK | |
run: ./dist-macos.sh | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
name: ondk-macos | |
path: dist/*.tar.xz | |
- name: Upload release assets | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
files: dist/*.tar.xz | |
- name: Remove x64 artifact | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: macos-x64 | |
failOnError: false |