v0.1-alpha.61 #101
Workflow file for this run
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
on: | |
release: | |
types: [created] | |
push: | |
branches: [master] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
compile_windows: | |
runs-on: ubuntu-latest | |
steps: | |
- run: curl https://get.wasmer.io -sSfL | sh | |
- uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- run: aws s3 sync s3://${{ secrets.S3_BUCKET_PUBLIC }}/lang-runners lang-runners | |
- name: Compile windows runners | |
run: | | |
source ~/.wasmer/wasmer.sh | |
for runner in lang-runners/*.wasm; do | |
wasmer compile --target x86_64-pc-windows-msvc --llvm "$runner" -o "${runner/.wasm/.wasmu}" | |
rm "$runner" | |
done | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: windows-runners | |
path: lang-runners/ | |
build: | |
needs: compile_windows | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu | |
cargoargs: --features build-llvm,jemalloc | |
- os: macos | |
cargoargs: --features build-llvm,jemalloc | |
- os: windows | |
cargoargs: --features build-cranelift,mimalloc | |
steps: | |
- uses: actions/checkout@v2 | |
- id: get_release | |
uses: bruceadams/get-release@v1.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cargo | |
key: cargo-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }} | |
- uses: actions/cache@v2 | |
with: | |
path: target | |
key: build-${{ matrix.os }} | |
- uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- run: git clone https://github.com/robot-rumble/logic ../logic | |
- run: aws s3 sync s3://${{ secrets.S3_BUCKET_PUBLIC }}/lang-runners ../logic/wasm-dist/lang-runners | |
- run: aws s3 sync s3://${{ secrets.S3_BUCKET_BUILD }}/cli-assets dist | |
- if: matrix.os == 'windows' | |
uses: actions/download-artifact@v2 | |
with: | |
name: windows-runners | |
path: compiled_runners | |
- if: matrix.os == 'windows' | |
run: echo "COMPILED_RUNNERS=compiled_runners" >> $GITHUB_ENV | |
shell: bash | |
- if: matrix.os == 'macos' && contains(matrix.cargoargs, 'build-llvm') | |
run: | | |
brew install llvm@12 | |
echo "LLVM_SYS_120_PREFIX=$(brew --prefix llvm@12)" >> $GITHUB_ENV | |
echo 'LDFLAGS="-L/usr/local/opt/llvm@12/lib"' >> $GITHUB_ENV | |
echo 'CPPFLAGS="-I/usr/local/opt/llvm@12/include"' >> $GITHUB_ENV | |
- if: matrix.os == 'ubuntu' && contains(matrix.cargoargs, 'build-llvm') | |
run: | | |
wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main' -y | |
sudo apt update | |
sudo apt install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang | |
- run: cargo build --release --no-default-features ${{matrix.cargoargs}} | |
env: | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
- if: matrix.os == 'windows' | |
run: | | |
mkdir release | |
cp -Path target/release/rumblebot.exe -Destination release | |
cp -Path README.md -Destination release | |
- if: matrix.os == 'macos' || matrix.os == 'ubuntu' | |
run: | | |
mkdir release | |
cp target/release/rumblebot release | |
cp README.md release | |
- run: 7z a release.zip ./release/* | |
- uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: release.zip | |
asset_name: rumblebot-${{ matrix.os }}.zip | |
asset_content_type: application/zip |