mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +01:00
ci: cross compiling
This commit is contained in:
parent
c97d6440f3
commit
9859b14bec
3 changed files with 74 additions and 25 deletions
93
.github/workflows/build.yaml
vendored
93
.github/workflows/build.yaml
vendored
|
|
@ -4,37 +4,86 @@ on:
|
|||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.target }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
deb: true
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
- os: windows-latest
|
||||
target: aarch64-pc-windows-msvc
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cargo build --release --all-features
|
||||
- name: get version
|
||||
id: version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Zipping files (exe)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
7z a pay-respects-${{ matrix.os }}.zip ./target/release/pay-respects.exe
|
||||
- name: setup Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: Zipping files (unix)
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
7z a pay-respects-${{ matrix.os }}.zip ./target/release/pay-respects
|
||||
# will need to static link openssl
|
||||
# - name: install cross
|
||||
# if: ${{ runner.os == 'Linux' }}
|
||||
# uses: actions-rs/cargo@v1
|
||||
# with:
|
||||
# command: install
|
||||
# args: cross --locked
|
||||
|
||||
- name: Uploading to release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: pay-respects-${{ matrix.os }}.zip
|
||||
allowUpdates: true
|
||||
makeLatest: true
|
||||
- name: build
|
||||
run:
|
||||
cargo build --release --all-features --locked --target ${{ matrix.target }}
|
||||
|
||||
- name: install cargo-deb
|
||||
if: ${{ matrix.deb == true }}
|
||||
uses: actions-rs/install@v0.1
|
||||
with:
|
||||
crate: cargo-deb
|
||||
|
||||
- name: build deb
|
||||
if: ${{ matrix.deb == true }}
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: deb
|
||||
args: --no-build --no-strip --output=. --target=${{ matrix.target }}
|
||||
|
||||
- name: zipping files (exe)
|
||||
if: runner.os == 'Windows'
|
||||
# for some reason Windows doesn't support environment variables?
|
||||
run: >
|
||||
7z a pay-respects-${{ matrix.target }}.zip
|
||||
./target/${{ matrix.target }}/release/pay-respects.exe
|
||||
|
||||
- name: zipping files (unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: >
|
||||
tar -czf pay-respects-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
|
||||
-C target/${{ matrix.target }}/release pay-respects
|
||||
|
||||
- name: uploading to release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: |
|
||||
*.tar.gz
|
||||
*.zip
|
||||
*.deb
|
||||
allowUpdates: true
|
||||
makeLatest: true
|
||||
|
||||
|
|
|
|||
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -371,9 +371,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.91"
|
||||
version = "1.0.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "307e3004becf10f5a6e0d59d20f3cd28231b0e0827a96cd3e0ce6d14bc1e4bb3"
|
||||
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
[package]
|
||||
name = "pay-respects"
|
||||
authors = ["iff <iff@ik.me>"]
|
||||
version = "0.5.12"
|
||||
edition = "2021"
|
||||
|
||||
|
|
@ -30,7 +31,6 @@ textwrap = { version = "0.16", features = ["terminal_size"], optional = true}
|
|||
pay-respects-parser = "0.2.6"
|
||||
# pay-respects-parser = { path = "../pay-respects-parser" }
|
||||
|
||||
|
||||
[features]
|
||||
runtime-rules = ["dep:serde", "dep:toml"]
|
||||
request-ai = ["dep:serde", "dep:serde_json", "dep:curl", "dep:textwrap"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue