Skip to content

Commit

Permalink
try: 🥠CI
Browse files Browse the repository at this point in the history
  • Loading branch information
LycasLdt committed Feb 7, 2024
1 parent aec437b commit fda201a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 53 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/build.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci

on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
# - target: aarch64-unknown-linux-gnu
# os: ubuntu-latest
# use-cross: true
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
use-cross: true
# - target: aarch64-apple-darwin
# os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
# - target: universal-apple-darwin
# os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
env:
BUILD_CMD: cargo
steps:
- uses: actions/checkout@v4

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Cache rust
uses: Swatinem/rust-cache@v2

- name: Install cross
if: matrix.use-cross
shell: bash
run: |
cargo install --force cross
echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Build
shell: bash
run: $BUILD_CMD build --release --target=${{ matrix.target }}
- name: Select bin name
id: bin-name
shell: bash
run: |
BIN_NAME="rabdog"
case ${{ matrix.os }} in windows-*) BIN_NAME = "rabdog.exe" ;; esac
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
- name: Upload as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}_${{ steps.bin-name.outputs.BIN_NAME }}
path: /target/${{ matrix.target }}/release/${{ steps.bin-name.outputs.BIN_NAME }}
10 changes: 10 additions & 0 deletions Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ cbc = { version = "0.1", features = ["std"] }
percent-encoding = "2.3"

tokio = { version = "1", features = ["rt-multi-thread", "sync", "macros", "signal"] }
reqwest = { version = "0.11", features = ["json"] }
futures = "0.3"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

[target.'cfg(unix)'.dependencies]
reqwest = { version = "0.11", features = ["json", "native-tls-vendored"] }

[target.'cfg(not(unix))'.dependencies]
reqwest = { version = "0.11", features = ["json"] }

[package.metadata.winres]
LegalCopyright = "LycasLdt"

Expand Down

0 comments on commit fda201a

Please sign in to comment.