Skip to content

Commit

Permalink
Cache crates in CI
Browse files Browse the repository at this point in the history
Update release.yml

Update release.yml

Update main.rs

Update release.yml

Update release.yml

Update release.yml
  • Loading branch information
zdimension committed Jun 1, 2022
1 parent 6fe6729 commit 5a73a84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Build release (Windows)
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=x86_64-pc-windows-msvc
- name: Build archive
run: |
Compress-Archive -Path target\x86_64-pc-windows-msvc\release\usbrawmap.exe, usbrawmap.toml -DestinationPath release.zip
- name: Upload binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_name: usbrawmap-${{ github.event.release.tag-name }}-x86_64.exe
asset_path: |
target/x86_64-pc-windows-msvc/release/usbrawmap.exe
asset_name: usbrawmap-${{ github.event.release.tag_name }}-x86_64.zip
asset_path: release.zip
asset_content_type: application/x-zip
upload_url: ${{ github.event.release.upload_url }}
10 changes: 4 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ impl<'de> Deserialize<'de> for MappingConfig {
{
HashMap::<String, MappingAction>::deserialize(deserializer)?
.into_iter()
.map(|(k, v)| {
k.parse()
.map(|k| (k, (Mapping(k, v))))
.map_err(|e| serde::de::Error::custom(e))
})
.map(|(k, v)| k.parse()
.map(|k| (k, (Mapping(k, v))))
.map_err(serde::de::Error::custom))
.collect::<Result<_, D::Error>>()
.map(MappingConfig)
}
Expand All @@ -101,7 +99,7 @@ fn main() -> anyhow::Result<()> {
println!("Loaded {} mappings", config.mappings.0.len());

let thread = thread::spawn(move || -> Result<(), anyhow::Error> {
let driver = UsbPcapDriver::new(&Path::new(&format!(
let driver = UsbPcapDriver::new(Path::new(&format!(
r"\\.\USBPcap{}",
config.general.driver
)))
Expand Down

0 comments on commit 5a73a84

Please sign in to comment.