Skip to content

Commit

Permalink
Merge pull request #20 from TextsHQ/conan/windows_build_fix
Browse files Browse the repository at this point in the history
ci: Fix Windows build and warnings
  • Loading branch information
1Conan authored Feb 7, 2024
2 parents 52b2f41 + 78db093 commit 6f36be6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,58 +55,49 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Configure git for private repos
env:
TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config --global url."https://${TOKEN}:[email protected]/".insteadOf "https://github.com/"
git config --global url."https://${{ secrets.GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Cache cargo registry
uses: actions/cache@v2
- name: Cache cargo
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: cargo-registry-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}
key: cargo-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/bin
target
- name: Cache cargo bin
uses: actions/cache@v2
with:
path: ~/.cargo/bin
key: cargo-bin-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: cargo-build-target-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}

- name: Install latest Rust stable
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn --ignore-scripts

- name: Build
run: yarn build --target=${{ matrix.target }}

# Until GH action adds M1 runners, can't run aarch64 libs
# Until GH action adds M1 runners, can't run aarch64 libs
- name: Test
if: ${{ matrix.architecture == 'x64' }}
run: yarn test

- name: Publish
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
run: |
yarn package --target_arch=${{ matrix.architecture }}
yarn upload-binary
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.8.6"
edition = "2018"

[lib]
crate-type = ["cdylib", "staticlib"]
crate-type = ["cdylib"]

[dependencies]
log = "0.4"
Expand Down

0 comments on commit 6f36be6

Please sign in to comment.