Skip to content

Commit

Permalink
Play around with build
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Mar 25, 2024
1 parent 01e303f commit b0dd09a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 58 deletions.
98 changes: 50 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
on:
release:
types: [created]
push:
branches: [master]

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -39,12 +41,12 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-22.04
cargoargs: --features build-llvm
# - os: macos-12
# cargoargs: --features build-llvm
# - os: windows-latest
# cargoargs: ''
- os: ubuntu-latest
cargoargs: ''
- os: macos-latest
cargoargs: ''
- os: windows-latest
cargoargs: ''

steps:
- uses: actions/checkout@v2
Expand All @@ -54,14 +56,14 @@ jobs:
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: 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:
Expand All @@ -83,41 +85,41 @@ jobs:
run: echo "COMPILED_RUNNERS=compiled_runners" >> $GITHUB_ENV
shell: bash

- if: matrix.os == 'macos-12'
run: |
brew install llvm@12
echo "LLVM_SYS_120_PREFIX=$(brew --prefix llvm)" >> $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-22.04'
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
# - if: matrix.os == 'macos-12'
# run: |
# brew install llvm@12
# echo "LLVM_SYS_120_PREFIX=$(brew --prefix llvm)" >> $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-22.04'
# 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-latest'
run: |
mkdir release
cp -Path target/release/rumblebot.exe -Destination release
cp -Path README.md -Destination release
- if: matrix.os == 'macos-12' || matrix.os == 'ubuntu-22.04'
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
# - if: matrix.os == 'windows-latest'
# run: |
# mkdir release
# cp -Path target/release/rumblebot.exe -Destination release
# cp -Path README.md -Destination release

# - if: matrix.os == 'macos-12' || matrix.os == 'ubuntu-22.04'
# 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ elm-stuff/
### JetBrains template
.idea
*.iml
bots
28 changes: 19 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,21 @@ sentry = "0.32.2"
[features]
default = ["build-cranelift"]
build-cranelift = ["wasmer-compiler-cranelift"]
build-llvm = ["wasmer-compiler-llvm"]
build-llvm = ["wasmer-compiler-llvm", "inkwell", "llvm-sys-120"]

[build-dependencies]
wasmer = { version = "2.0", default-features = false, features = ["universal"] }
wasmer-engine = "2.0"
wasmer-compiler-cranelift = { version = "2.0", optional = true }
wasmer-compiler-llvm = { version = "2.0", optional = true }
llvm-sys-120 = { package = "llvm-sys", version = "120.3.2", features = ["prefer-static"], optional = true }

[dependencies.inkwell]
package = "inkwell"
version = "=0.1.0-beta.4"
default-features = false
features = ["llvm12-0"]
optional = true

[patch.crates-io]
multipart = { git = "https://github.com/coolreader18/multipart", rev = "ee033794ada7c322e3cef50713854dff873f546d" }

0 comments on commit b0dd09a

Please sign in to comment.