From c9bec10a8ee3c11b38a41822c3c573786c0f5e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikkel=20Hjortsh=C3=B8j?= Date: Sat, 11 Apr 2020 17:46:44 +0200 Subject: [PATCH] Setup POC nightly.yml --- .github/workflows/nightly.yml | 93 ++++++++++++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 24804b9f8..7d67d370d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,11 +2,10 @@ name: Nightly on: [push] jobs: - build: + build_windows: runs-on: windows-latest steps: - uses: actions/checkout@v1 - - name: Install cURL run: choco install curl - name: Download and unpack LLVM bins @@ -25,22 +24,100 @@ jobs: run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin run examples/demo/demo.odin + - name: Copy artifacts + run: | + mkdir dist + cp odin.exe dist + cp -r shared dist + cp -r core dist + cp -r bin dist + cp -r examples dist - name: Upload artifact uses: actions/upload-artifact@v1 with: - name: exe - path: odin.exe + name: windows_artifacts + path: dist + build_ubuntu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: (Linux) Download LLVM + run: sudo apt-get install llvm + - name: build odin + run: make release + - name: Odin run + run: ./odin run examples/demo/demo.odin + - name: Copy artifacts + run: | + mkdir dist + cp odin dist + cp -r shared dist + cp -r core dist + cp -r examples dist + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: ubuntu_artifacts + path: dist + build_macos: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v1 + - name: Download LLVM and setup PATH + run: | + brew install llvm + echo ::add-path::/usr/local/opt/llvm/bin + echo ::set-env name=CPATH::`xcrun --show-sdk-path`/usr/include + - name: build odin + run: make release + - name: Odin run + run: ./odin run examples/demo/demo.odin + - name: Copy artifacts + run: | + mkdir dist + cp odin dist + cp -r shared dist + cp -r core dist + cp -r examples dist + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: macos_artifacts + path: dist upload_b2: - runs-on: [linux] - needs: [build] + runs-on: [ubuntu-latest] + needs: [build_windows, build_macos, build_ubuntu] steps: - name: Install B2 CLI shell: bash run: sudo pip install --upgrade b2 - - name: Download exe + - name: Download Windows artifacts uses: actions/download-artifact@v1 with: - name: exe + name: windows_artifacts + - name: Download Ubuntu artifacts + uses: actions/download-artifact@v1 + with: + name: ubuntu_artifacts + - name: Download macOS artifacts + uses: actions/download-artifact@v1 + with: + name: macos_artifacts - name: List artifacts run: find . -type f -printf "%T@ %p\n" | sort -nr | cut -d\ -f2- + - name: Create archieves + run: | + now=$(date +'%Y-%m-%d') + 7z a test/odin-windows-amd64-nightly+$now.zip windows_artifacts/* + 7z a test/odin-ubuntu-amd64-nightly+$now.zip ubuntu_artifacts/* + 7z a test/odin-macos-amd64-nightly+$now.zip macos_artifacts/* + - name: Upload artifacts to b2 + shell: bash + env: + APPID: ${{ secrets.B2_APPID }} + APPKEY: ${{ secrets.B2_APPKEY }} + run: | + b2 authorize-account "$APPID" "$APPKEY" + b2 sync --delete test b2://odin-binaries/nightly + b2 clear-account