From 1b7659b046d58dbd32ed527e047521c129379006 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 17:43:14 +0200 Subject: [PATCH 1/7] feature(build): add a custom github ci build --- .github/workflows/release.yml | 271 ++++++++++++++++++++++++++++++++++ Cargo.toml | 22 ++- 2 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4c1f4f8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,271 @@ +# Copyright 2022-2024, axodotdev +# SPDX-License-Identifier: MIT or Apache-2.0 +# +# CI that: +# +# * checks for a Git Tag that looks like a release +# * builds artifacts with cargo-dist (archives, installers, hashes) +# * uploads those artifacts to temporary workflow zip +# * on success, uploads the artifacts to a GitHub Release +# +# Note that the GitHub Release will be created with a generated +# title/body based on your changelogs. + +name: Release + +permissions: + contents: write + +# This task will run whenever you push a git tag that looks like a version +# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc. +# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where +# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION +# must be a Cargo-style SemVer Version (must have at least major.minor.patch). +# +# If PACKAGE_NAME is specified, then the announcement will be for that +# package (erroring out if it doesn't have the given version or isn't cargo-dist-able). +# +# If PACKAGE_NAME isn't specified, then the announcement will be for all +# (cargo-dist-able) packages in the workspace with that version (this mode is +# intended for workspaces with only one dist-able package, or with all dist-able +# packages versioned/released in lockstep). +# +# If you push multiple tags at once, separate instances of this workflow will +# spin up, creating an independent announcement for each one. However, GitHub +# will hard limit this to 3 tags per commit, as it will assume more tags is a +# mistake. +# +# If there's a prerelease-style suffix to the version, then the release(s) +# will be marked as a prerelease. +on: + push: + tags: + - '**[0-9]+.[0-9]+.[0-9]+*' + pull_request: + +jobs: + # Run 'cargo dist plan' (or host) to determine what tasks we need to do + plan: + runs-on: ubuntu-latest + outputs: + val: ${{ steps.plan.outputs.manifest }} + tag: ${{ !github.event.pull_request && github.ref_name || '' }} + tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} + publishing: ${{ !github.event.pull_request }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + # we specify bash to get pipefail; it guards against the `curl` command + # failing. otherwise `sh` won't catch that `curl` returned non-0 + shell: bash + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.3/cargo-dist-installer.sh | sh" + # sure would be cool if github gave us proper conditionals... + # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible + # functionality based on whether this is a pull_request, and whether it's from a fork. + # (PRs run on the *source* but secrets are usually on the *target* -- that's *good* + # but also really annoying to build CI around when it needs secrets to work right.) + - id: plan + run: | + cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json + echo "cargo dist ran successfully" + cat plan-dist-manifest.json + echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT" + - name: "Upload dist-manifest.json" + uses: actions/upload-artifact@v4 + with: + name: artifacts-plan-dist-manifest + path: plan-dist-manifest.json + + # Build and packages all the platform-specific things + build-local-artifacts: + name: build-local-artifacts (${{ join(matrix.targets, ', ') }}) + # Let the initial task tell us to not run (currently very blunt) + needs: + - plan + if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }} + strategy: + fail-fast: false + # Target platforms/runners are computed by cargo-dist in create-release. + # Each member of the matrix has the following arguments: + # + # - runner: the github runner + # - dist-args: cli flags to pass to cargo dist + # - install-dist: expression to run to install cargo-dist on the runner + # + # Typically there will be: + # - 1 "global" task that builds universal installers + # - N "local" tasks that build each platform's binaries and platform-specific installers + matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }} + runs-on: ${{ matrix.runner }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json + steps: + - name: enable windows longpaths + run: | + git config --global core.longpaths true + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: swatinem/rust-cache@v2 + with: + key: ${{ join(matrix.targets, '-') }} + - name: Install cargo-dist + run: ${{ matrix.install_dist }} + # Get the dist-manifest + - name: Fetch local artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: target/distrib/ + merge-multiple: true + - name: Install dependencies + run: | + ${{ matrix.packages_install }} + - name: Build artifacts + run: | + # Actually do builds and make zips and whatnot + cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json + echo "cargo dist ran successfully" + - id: cargo-dist + name: Post-build + # We force bash here just because github makes it really hard to get values up + # to "real" actions without writing to env-vars, and writing to env-vars has + # inconsistent syntax between shell and powershell. + shell: bash + run: | + # Parse out what we just built and upload it to scratch storage + echo "paths<> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + + cp dist-manifest.json "$BUILD_MANIFEST_NAME" + - name: "Upload artifacts" + uses: actions/upload-artifact@v4 + with: + name: artifacts-build-local-${{ join(matrix.targets, '_') }} + path: | + ${{ steps.cargo-dist.outputs.paths }} + ${{ env.BUILD_MANIFEST_NAME }} + + # Build and package all the platform-agnostic(ish) things + build-global-artifacts: + needs: + - plan + - build-local-artifacts + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + shell: bash + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.3/cargo-dist-installer.sh | sh" + # Get all the local artifacts for the global tasks to use (for e.g. checksums) + - name: Fetch local artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: target/distrib/ + merge-multiple: true + - id: cargo-dist + shell: bash + run: | + cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json + echo "cargo dist ran successfully" + + # Parse out what we just built and upload it to scratch storage + echo "paths<> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + + cp dist-manifest.json "$BUILD_MANIFEST_NAME" + - name: "Upload artifacts" + uses: actions/upload-artifact@v4 + with: + name: artifacts-build-global + path: | + ${{ steps.cargo-dist.outputs.paths }} + ${{ env.BUILD_MANIFEST_NAME }} + # Determines if we should publish/announce + host: + needs: + - plan + - build-local-artifacts + - build-global-artifacts + # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine) + if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: "ubuntu-20.04" + outputs: + val: ${{ steps.host.outputs.manifest }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.3/cargo-dist-installer.sh | sh" + # Fetch artifacts from scratch-storage + - name: Fetch artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: target/distrib/ + merge-multiple: true + # This is a harmless no-op for GitHub Releases, hosting for that happens in "announce" + - id: host + shell: bash + run: | + cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json + echo "artifacts uploaded and released successfully" + cat dist-manifest.json + echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" + - name: "Upload dist-manifest.json" + uses: actions/upload-artifact@v4 + with: + # Overwrite the previous copy + name: artifacts-dist-manifest + path: dist-manifest.json + + # Create a GitHub Release while uploading all files to it + announce: + needs: + - plan + - host + # use "always() && ..." to allow us to wait for all publish jobs while + # still allowing individual publish jobs to skip themselves (for prereleases). + # "host" however must run to completion, no skipping allowed! + if: ${{ always() && needs.host.result == 'success' }} + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: "Download GitHub Artifacts" + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: artifacts + merge-multiple: true + - name: Cleanup + run: | + # Remove the granular manifests + rm -f artifacts/*-dist-manifest.json + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ needs.plan.outputs.tag }} + name: ${{ fromJson(needs.host.outputs.val).announcement_title }} + body: ${{ fromJson(needs.host.outputs.val).announcement_github_body }} + prerelease: ${{ fromJson(needs.host.outputs.val).announcement_is_prerelease }} + artifacts: "artifacts/*" diff --git a/Cargo.toml b/Cargo.toml index 951c5c1..f7bad1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "caesar-transfer-iu" -version = "0.2.0" +version = "0.3.1" edition = "2021" build = "src/build.rs" authors = ["Manuel Keidel", "Patryk Hegenberg", "Krzysztof Stankiewicz"] +description = "A CLI tool for secure, end-to-end encrypted file transfer." +repository = "https://github.com/PatrykHegenberg/caesar-transfer" [[bin]] name = "caesar" @@ -54,3 +56,21 @@ hex = "0.4.3" [build-dependencies] prost-build = "0.12.4" + +# The profile that 'cargo dist' will build with +[profile.dist] +inherits = "release" +lto = "thin" + +# Config for 'cargo dist' +[workspace.metadata.dist] +# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) +cargo-dist-version = "0.13.3" +# CI backends to support +ci = ["github"] +# The installers to generate for each app +installers = [] +# Target platforms to build apps for (Rust target-triple syntax) +targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] +# Publish jobs to run in CI +pr-run-mode = "plan" -- 2.47.2 From 42e4a63a6a921dbc64e7a7067ec3ae5d611d900f Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 21:22:17 +0200 Subject: [PATCH 2/7] fix(sender,receiver): fixed bug with sender and receiver trying to connect to https with http address to fix this bug i had to change the way a user can support a relay address. the user can no longer provide the address in the form "0.0.0.0:8000" instead he has to use "ws://0.0.0.0:8000" or "wss://0.0.0.0:8000" the switch between ws/http or wss/https is handle by the program --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/receiver/http_client.rs | 4 ++-- src/receiver/mod.rs | 13 ++++++++----- src/sender/client.rs | 4 ++-- src/sender/mod.rs | 4 ++-- src/sender/util.rs | 9 +++++++++ 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae84c6b..6430aa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -406,7 +406,7 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "caesar-transfer-iu" -version = "0.2.0" +version = "0.3.1" dependencies = [ "aes-gcm", "axum 0.7.5", diff --git a/Cargo.toml b/Cargo.toml index 951c5c1..8e8903b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "caesar-transfer-iu" -version = "0.2.0" +version = "0.3.1" edition = "2021" build = "src/build.rs" authors = ["Manuel Keidel", "Patryk Hegenberg", "Krzysztof Stankiewicz"] diff --git a/src/receiver/http_client.rs b/src/receiver/http_client.rs index df700f0..518b7b8 100644 --- a/src/receiver/http_client.rs +++ b/src/receiver/http_client.rs @@ -8,7 +8,7 @@ use crate::relay::transfer::TransferResponse; type Result = std::result::Result>; pub async fn download_info(relay: &str, name: &str) -> Result { - let url = String::from("http://") + relay; + let url = String::from(relay); let hashed_name = Sha256::digest(name.as_bytes()); let hashed_string = hex::encode(hashed_name); @@ -25,7 +25,7 @@ pub async fn download_info(relay: &str, name: &str) -> Result } pub async fn download_success(relay: &str, name: &str) -> Result<()> { - let url = String::from("http://") + relay; + let url = String::from(relay); let hashed_name = Sha256::digest(name.as_bytes()); let hashed_string = hex::encode(hashed_name); diff --git a/src/receiver/mod.rs b/src/receiver/mod.rs index 3e071c7..c31db42 100644 --- a/src/receiver/mod.rs +++ b/src/receiver/mod.rs @@ -38,7 +38,7 @@ pub mod client; pub mod http_client; -use crate::receiver::client as receiver; +use crate::{receiver::client as receiver, sender::util::replace_protocol}; use tokio_tungstenite::{ connect_async, @@ -47,9 +47,12 @@ use tokio_tungstenite::{ use tracing::{debug, error}; pub async fn start_receiver(relay: &str, name: &str) { - let res = http_client::download_info(relay, name).await.unwrap(); + let http_url = replace_protocol(relay); + let res = http_client::download_info(http_url.as_str(), name) + .await + .unwrap(); debug!("Got room_id from Server: {:?}", res); - let res_ip = res.ip + ":9000"; + let res_ip = String::from("ws://") + res.ip.as_str() + ":9000"; if let Err(local_err) = start_ws_com(res_ip.as_str(), res.local_room_id.as_str()).await { debug!("Failed to connect local: {local_err}"); @@ -57,7 +60,7 @@ pub async fn start_receiver(relay: &str, name: &str) { debug!("Failed to connect remote: {relay_err}"); } } - let success = http_client::download_success(relay, name).await; + let success = http_client::download_success(http_url.as_str(), name).await; match success { Ok(()) => debug!("Success"), Err(e) => error!("Error: {e:?}"), @@ -72,7 +75,7 @@ pub async fn start_receiver(relay: &str, name: &str) { } pub async fn start_ws_com(relay: &str, name: &str) -> Result<(), Box> { - let url = String::from("ws://") + relay + "/ws"; + let url = String::from(relay) + "/ws"; let Ok(mut request) = url.into_client_request() else { println!("Error: Failed to create request."); return Err("Failed to create request".into()); diff --git a/src/sender/client.rs b/src/sender/client.rs index 02f0ad6..321de17 100644 --- a/src/sender/client.rs +++ b/src/sender/client.rs @@ -1,5 +1,5 @@ use crate::sender::http_client::send_info; -use crate::sender::util::hash_random_name; +use crate::sender::util::{hash_random_name, replace_protocol}; use crate::shared::{ packets::{ list_packet, packet::Value, ChunkPacket, HandshakePacket, HandshakeResponsePacket, @@ -135,7 +135,7 @@ fn on_create_room( let send_url = url.to_string(); let h_name = hash_name.to_string(); - let server_url = String::from("http://") + relay.as_str(); + let server_url = replace_protocol(relay.as_str()); let res = std::thread::spawn(move || { tokio::runtime::Builder::new_current_thread() .enable_all() diff --git a/src/sender/mod.rs b/src/sender/mod.rs index a57d52a..a41c886 100644 --- a/src/sender/mod.rs +++ b/src/sender/mod.rs @@ -85,7 +85,7 @@ pub async fn start_sender(relay: Arc, files: Arc>) { }); let local_thread = task::spawn(async move { connect_to_server( - Arc::new(String::from("0.0.0.0:9000")), + Arc::new(String::from("ws://0.0.0.0:9000")), local_files.clone(), Some(local_room_id), local_relay.clone(), @@ -146,7 +146,7 @@ async fn connect_to_server( tx: mpsc::Sender<()>, is_local: bool, ) { - let url = format!("ws://{}/ws", relay); + let url = format!("{}/ws", relay); let message_relay = format!("{}", message_server); let transfer_name = format!("{}", transfer_name); match url.clone().into_client_request() { diff --git a/src/sender/util.rs b/src/sender/util.rs index d429a24..d8927b8 100644 --- a/src/sender/util.rs +++ b/src/sender/util.rs @@ -32,6 +32,15 @@ pub fn hash_random_name(name: String) -> String { hex::encode(hashed_name) } +pub fn replace_protocol(address: &str) -> String { + let mut result = address.to_string(); + result = result.replace("ws://", "http://"); + + result = result.replace("wss://", "https://"); + + result +} + #[cfg(test)] mod tests { use super::*; -- 2.47.2 From 6162e6ac583df262589b35ecea8b077b4f41a148 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 21:35:40 +0200 Subject: [PATCH 3/7] fix(build): test fix for github workflow --- .github/workflows/publish.yml | 97 ++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 556083c..91bbaed 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Build and Publish on: push: tags: - - '*' + - "*" jobs: publish: @@ -14,66 +14,67 @@ jobs: include: - name: Windows os: windows-latest - artifact_name: target/release/caesar.exe - asset_name: caesar-windows + artifact_name: caesar.exe + asset_name: caesar-windows.exe - name: MacOS os: macos-latest - artifact_name: target/release/caesar + artifact_name: caesar asset_name: caesar-macos - name: Linux os: ubuntu-latest - artifact_name: target/release/caesar + artifact_name: caesar asset_name: caesar-linux steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: Install deps on MacOS - if: matrix.os == 'macos-latest' - run: brew install protobuf + - name: Install deps on MacOS + if: matrix.os == 'macos-latest' + run: brew install protobuf - - name: Install deps on Windows - if: matrix.os == 'windows-latest' - run: choco install protobuf + - name: Install deps on Windows + if: matrix.os == 'windows-latest' + run: choco install protobuf - - name: Install deps on Linux - if: matrix.os == 'ubuntu-latest' - run: sudo apt-get -y install protobuf-compiler + - name: Install deps on Linux + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get -y install protobuf-compiler - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true - - name: Build - run: cargo build --release --locked + - name: Build + run: cargo build --release --locked - - name: Upload binaries to release - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.asset_name }} - path: ${{ matrix.artifact_name }} + - name: Upload binaries to release + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.asset_name }} + path: target/release/${{ matrix.artifact_name }} - - name: Create Release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - body: 'Release of ${{ github.ref }}' + - name: Create Release + id: create_release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + body: "Release of ${{ github.ref }}" - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.upload_binaries.outputs.path }} - asset_name: ${{ matrix.asset_name }} - asset_content_type: application/octet-stream + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: target/release/${{ matrix.artifact_name }} + asset_name: ${{ matrix.asset_name }} + asset_content_type: application/octet-stream -- 2.47.2 From a15fa9d5a9351ba5ed2e615117ff638dd8b8c631 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 21:42:10 +0200 Subject: [PATCH 4/7] fix(build): next error in publish.yml fixed --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 91bbaed..abec72c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: - name: Install deps on Windows if: matrix.os == 'windows-latest' - run: choco install protobuf + run: choco install protoc - name: Install deps on Linux if: matrix.os == 'ubuntu-latest' -- 2.47.2 From 82c4aa33127252b38c880cbcfa3c656fab25d213 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 22:03:46 +0200 Subject: [PATCH 5/7] added system dependencies to Cargo.toml --- Cargo.lock | 2 +- Cargo.toml | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae84c6b..6430aa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -406,7 +406,7 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "caesar-transfer-iu" -version = "0.2.0" +version = "0.3.1" dependencies = [ "aes-gcm", "axum 0.7.5", diff --git a/Cargo.toml b/Cargo.toml index f7bad1a..4b0c475 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,20 @@ ci = ["github"] # The installers to generate for each app installers = [] # Target platforms to build apps for (Rust target-triple syntax) -targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] +targets = [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu", + "x86_64-pc-windows-msvc", +] # Publish jobs to run in CI pr-run-mode = "plan" + +[workspace.metadata.dist.dependecies.homebrew] +protobuf = "*" + +[workspace.metadata.dist.dependecies.apt] +protobuf-compile = "*" + +[workspace.metadata.dist.dependecies.chocolatey] +protoc = "*" -- 2.47.2 From e7f576bff6f8516c63611b3b8b30d1c39c038cc0 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 22:42:41 +0200 Subject: [PATCH 6/7] fix(build): added more system dependencies --- Cargo.lock | 5 +++-- Cargo.toml | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6430aa9..e948a9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -413,6 +413,7 @@ dependencies = [ "axum-client-ip", "axum-extra", "base64 0.22.0", + "cc", "clap 4.5.4", "dotenv", "dotenvy", @@ -448,9 +449,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" [[package]] name = "cfg-if" diff --git a/Cargo.toml b/Cargo.toml index 4b0c475..2419c6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,6 +56,7 @@ hex = "0.4.3" [build-dependencies] prost-build = "0.12.4" +cc = "1.0.96" # The profile that 'cargo dist' will build with [profile.dist] @@ -81,10 +82,21 @@ targets = [ pr-run-mode = "plan" [workspace.metadata.dist.dependecies.homebrew] -protobuf = "*" +protobuf = { version = "*", stage = ["build"] } +gcc = { version = "*", stage = ["build"] } +cmake = { version = "*", stage = ["build"] } +make = { version = "*", stage = ["build"] } +llvm = { version = "*", stage = ["build"] } +libcue = { version = "*", stage = ["build"] } [workspace.metadata.dist.dependecies.apt] -protobuf-compile = "*" +protobuf-compile = { version = "*", stage = ["build"] } [workspace.metadata.dist.dependecies.chocolatey] -protoc = "*" +protoc = { version = "*", stage = ["build"] } + +[workspace.metadata.dist.custom-runners] +aarch64-apple-darwin = "macos-latest" +x86_64-apple-darwin = "macos-12" +x86_64-unknown-linux-gnu = "ubuntu-latest" +x86_64-pc-windows-msvc = "windows-latest" -- 2.47.2 From 9a4a86f8770e8e645cea6425004ecdba7710c300 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 2 May 2024 23:21:25 +0200 Subject: [PATCH 7/7] fix(build): fix permissions in github action --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index abec72c..bd73b78 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,6 @@ name: Build and Publish - +permissions: + contents: write on: push: tags: -- 2.47.2