Skip to content

Commit

Permalink
Merge pull request #1389 from jqnatividad/1379-zipsign-self-update
Browse files Browse the repository at this point in the history
add zipsign signature verification to self-update
  • Loading branch information
jqnatividad authored Oct 26, 2023
2 parents 25585b7 + 41231ec commit 40f28bf
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/macOS-arm64-selfhosted-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ jobs:
cat docs/publishing_assets/README.txt docs/publishing_assets/qsv-${{ matrix.job.target }}.txt > qsv-${{ needs.analyze-tags.outputs.previous-tag }}/README
- name: zip up binaries
run: 7zz a -tzip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip ./qsv-${{ needs.analyze-tags.outputs.previous-tag }}/* -mx=9 -mmt=on
- name: install zipsign
run: |
cargo install zipsign
- name: Fetch zipsign private key
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.QSV_ZIPSIGN_PRIV_KEY }}
filename: "qsvpriv.key"
is-executable: false
working-directory: "."
- name: zipsign binary
run: |
zipsign sign zip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip qsvpriv.key
- name: Upload zipped binaries to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ jobs:
cat docs/publishing_assets/README.txt docs/publishing_assets/qsv-${{ matrix.job.target }}.txt > qsv-${{ needs.analyze-tags.outputs.previous-tag }}/README
- name: zip up binaries
run: 7z a -tzip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip ./qsv-${{ needs.analyze-tags.outputs.previous-tag }}/* -mx=9 -mmt=on
- name: install zipsign
run: |
cargo install zipsign
- name: Fetch zipsign private key
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.QSV_ZIPSIGN_PRIV_KEY }}
filename: "qsvpriv.key"
is-executable: false
working-directory: "."
- name: zipsign binary
run: |
zipsign sign zip qsv-${{ needs.analyze-tags.outputs.previous-tag }}-${{ matrix.job.target }}.zip qsvpriv.key
- name: Upload zipped binaries to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ self_update = { version = "0.39", features = [
"archive-zip",
"compression-zip-deflate",
"rustls",
"signatures",
], default-features = false, optional = true }
semver = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
Binary file added src/qsv-zipsign-public.key
Binary file not shown.
1 change: 1 addition & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ pub fn qsv_check_for_update(check_only: bool, no_confirm: bool) -> Result<bool,
.show_output(false)
.no_confirm(no_confirm)
.current_version(curr_version)
.verifying_keys([*include_bytes!("qsv-zipsign-public.key")])
.build()
{
Ok(update_job) => match update_job.update() {
Expand Down

0 comments on commit 40f28bf

Please sign in to comment.