Skip to content

Commit

Permalink
chore: Update Rust workflow to build and test in release mode, create…
Browse files Browse the repository at this point in the history
… release, and upload release asset
  • Loading branch information
edgarburgues committed May 15, 2024
1 parent ea56cbe commit 0d69006
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,27 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v2

- name: Set up Rust
- name: Install Rust toolchain
run: rustup target add x86_64-pc-windows-gnu

- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-gnu
override: true

- name: Install mingw
run: sudo apt-get install mingw-w64 -y

- name: Build the project
run: cargo build --release
run: cargo build --release --target x86_64-pc-windows-gnu

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ml2pdf.exe
path: target/release/ml2pdf.exe
name: rust-app
path: target/x86_64-pc-windows-gnu/release/ml2pdf.exe

publish:
runs-on: ubuntu-latest
Expand All @@ -40,7 +47,7 @@ jobs:
uses: actions/download-artifact@v2
with:
name: rust-app
path: target/release
path: target/x86_64-pc-windows-gnu/release

- name: Publish release
id: create_release
Expand All @@ -59,6 +66,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/release/ml2pdf.exe
asset_path: target/x86_64-pc-windows-gnu/release/ml2pdf.exe
asset_name: ml2pdf.exe
asset_content_type: application/octet-stream
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1", features = ["full"] }
printpdf = "0.7.0"
kuchiki = "0.8.1"
kuchiki = "0.8.1"

4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
components = ["rust-std", "rustfmt", "llvm-tools-preview"]
targets = ["x86_64-pc-windows-gnu"]

0 comments on commit 0d69006

Please sign in to comment.