Skip to content

Commit

Permalink
ci: build artifact on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Master-Hash committed Jan 21, 2025
1 parent 98af60f commit a290724
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 31 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
build:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- {
target: x86_64-pc-windows-gnu,
os: windows-2025,
feature: icu_segmenter,
}
- {
target: x86_64-pc-windows-gnu,
os: windows-2025,
feature: windows,
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-24.04,
feature: icu_segmenter,
}
- {
target: aarch64-unknown-linux-gnu,
os: ubuntu-24.04-arm,
feature: icu_segmenter,
}
- {
target: x86_64-apple-darwin,
os: macos-15,
feature: icu_segmenter,
}
- {
target: aarch64-apple-darwin,
os: macos-15,
feature: icu_segmenter,
}
steps:
- name: Checkout source code
uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.job.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.job.feature }}

- name: Show version information (Rust, cargo)
run: |
rustup -V
rustup toolchain list
rustup target add ${{ matrix.job.target }}
cargo -V
rustc -V
- name: Build
run: cargo build --locked --release --target=${{ matrix.job.target }} --no-default-features -F ${{ matrix.job.feature }}

- name: debug?
if: runner.os == 'Windows' || runner.os == 'Linux'
run: |
tree target/
- name: "Artifact upload"
uses: actions/upload-artifact@master
with:
name: ${{ matrix.job.target }}-libEWT-${{ matrix.job.feature }}
path: |
target/${{ matrix.job.target }}/release/*.dll
target/${{ matrix.job.target }}/release/*.so
target/${{ matrix.job.target }}/release/*.dylib
109 changes: 86 additions & 23 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
crate-type = ["cdylib"]

[dependencies]
icu_segmenter = { version = "1.5.0", optional = true }
icu_segmenter = { version = "2.0.0-beta1", optional = true }
libc = "0.2.169"
windows = { version = "0.59.0", features = [
"Data_Text",
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ This crate provides dynamic module which [emt.el](https://github.com/roife/emt)

### Pre-built

Download from [Releases](https://github.com/Master-Hash/ewt-rs/releases).
Download from Releases, or [CI Artifact](https://github.com/Master-Hash/ewt-rs/actions/workflows/build.yml) for unversioned binaries.

Be aware, I use radical compile-time arguments, so I don't guarantee any compatibility.
<!-- Please ignore the binary from Releases page. -->

My env:

* MSYS2 UCRT Emacs 29.4 (Windows)
* Windows 11 build 26100
* CPU >= with avx2 (or x86-64-v3)
The Windows `.dll` files are only compatible with Emacs built with UCRT. MSVCRT is not supported.

### Manually build

Expand Down

0 comments on commit a290724

Please sign in to comment.