Skip to content

Commit

Permalink
[Cargo, WF:release, WF:test_build] Add Windows installer support
Browse files Browse the repository at this point in the history
  • Loading branch information
m4heshd committed Apr 22, 2024
1 parent d4842dc commit 45203bf
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build-win32 = 'build --profile dist --package ufc-ripper --features=exe_res'
build-linux = 'build --profile dist --package ufc-ripper'
pack-win32 = 'run --release --package pack -- --platform win32'
pack-linux = 'run --release --package pack -- --platform linux'
create-installer-win32 = 'packager -p ufc-ripper --profile dist'
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ jobs:
# Package app for release
- name: Package app
run: cargo pack-${{ matrix.platform_alias }} --tag ${{ env.RELEASE_TAG }}
# Create Windows installer
- if: matrix.os == 'windows-latest'
name: Create Windows installer
shell: bash
run: |
cargo install cargo-packager --version 0.8.1 --locked
cargo create-installer-win32
rm -rf ./package/artifacts/.cargo-packager || true
# Upload release assets
- name: Upload assets to release ${{ github.event.release.tag_name }}
uses: softprops/action-gh-release@v2
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@ jobs:
# Package app for release
- name: Package app
run: cargo pack-${{ env.TARGET_PLATFORM }}
# Create Windows installer
- if: inputs.platform == 'windows-latest'
name: Create Windows installer
shell: bash
run: |
cargo install cargo-packager --version 0.8.1 --locked
cargo create-installer-win32
rm -rf ./package/artifacts/.cargo-packager || true
# Upload build artifact
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ufc-ripper-test-build-${{ github.run_number }}-artifacts
path: package/artifacts/${{ env.PACKAGE_NAME }}
path: package/artifacts/*
10 changes: 10 additions & 0 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ uuid = { version = "1.8.0", features = ["v4", "fast-rng"] }

[build-dependencies]
winresource = "0.1.17"

[package.metadata.packager]
product-name = "UFC Ripper"
identifier = "com.m4heshd.ufc-ripper"
resources = ["../config"]
icons = ["../project-res/images/ufc-ripper-icon.ico"]
out-dir = "../package/artifacts"

[package.metadata.packager.nsis]
installer-icon = "../project-res/images/ufc-ripper-icon.ico"
2 changes: 1 addition & 1 deletion pack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ clap = { version = "4.5.4", features = ["derive"] }
fs_extra = "1.3.0"
ufcr_libs = { path = "../ufcr_libs" }
zip = "0.6.6"
zip-extensions = { git = "https://github.com/m4heshd/zip-extensions-rs.git", branch = "mappable-file-options" }
zip-extensions = { git = "https://github.com/m4heshd/zip-extensions-rs.git", branch = "mappable-file-options" }

0 comments on commit 45203bf

Please sign in to comment.