From c3df754ff55a52b1304db9c27dc016f3d9acfa8b Mon Sep 17 00:00:00 2001 From: mautam Date: Mon, 7 Aug 2023 20:23:58 +0000 Subject: [PATCH] feat: Update workflow to auto publish binary --- .github/workflows/release.yml | 48 +++++++++++++++++++---------------- Cargo.lock | 29 ++++++++++++++------- Cargo.toml | 8 +++++- 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38970fb..08d7086 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,17 +11,8 @@ jobs: matrix: include: - os: ubuntu-latest - rust_target: x86_64-unknown-linux-musl - asset_name: action-validator_linux_amd64 - - os: macos-latest - rust_target: x86_64-apple-darwin - asset_name: action-validator_darwin_amd64 - - os: ubuntu-latest - rust_target: aarch64-unknown-linux-musl - asset_name: action-validator_linux_arm64 - - os: macos-latest - rust_target: aarch64-apple-darwin - asset_name: action-validator_darwin_arm64 + rust_target: x86_64-unknown-linux-gnu + asset_name: leftwm-theme_x86_64_linux_gnu runs-on: ${{ matrix.os }} @@ -52,16 +43,22 @@ jobs: env: RELEASE_TAG: ${{ github.ref }} run: | - mv Cargo.toml Cargo.toml.orig - sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.toml.orig >Cargo.toml - mv Cargo.lock Cargo.lock.orig - sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.lock.orig >Cargo.lock - + mv Cargo.toml Cargo.toml.origl2 + sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.toml.origl2 > Cargo.toml + mv Cargo.lock Cargo.lock.origl2 + sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.lock.origl2 > Cargo.lock - name: Install cross-compile linker for aarch64-unknown-linux-musl if: matrix.rust_target == 'aarch64-unknown-linux-musl' run: | sudo apt update sudo apt install gcc-aarch64-linux-gnu + - name: Install openssl + run: | + sudo apt update + sudo apt install openssl pkg-config libssl-dev + cargo clean + OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu" + OPENSSL_INCLUDE_DIR="/usr/include/openssl" - name: Build env: @@ -99,20 +96,27 @@ jobs: id: rust-install uses: dtolnay/rust-toolchain@stable + - name: Install openssl + run: | + sudo apt update + sudo apt install openssl pkg-config libssl-dev + cargo clean + OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu" + OPENSSL_INCLUDE_DIR="/usr/include/openssl" + - name: Set Cargo.toml version if: github.event_name == 'release' shell: bash env: RELEASE_TAG: ${{ github.ref }} run: | - mv Cargo.toml Cargo.toml.orig - sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.toml.orig >Cargo.toml - mv Cargo.lock Cargo.lock.orig - sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.lock.orig >Cargo.lock - + mv Cargo.toml Cargo.toml.origl2 + sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.toml.origl2 > Cargo.toml + mv Cargo.lock Cargo.lock.origl2 + sed "s/[0-9]*\\.[0-9]*\\.[0-9]*-git/${RELEASE_TAG##*\/v}/" Cargo.lock.origl2 > Cargo.lock - name: Publish crate if: github.event_name == 'release' env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} run: | cargo publish --allow-dirty diff --git a/Cargo.lock b/Cargo.lock index 632a8ab..f1a521c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,9 +96,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6b2562119bf28c3439f7f02db99faf0aa1a8cdfe5772a2ee155d32227239f0" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "jobserver", "libc", @@ -627,7 +627,7 @@ dependencies = [ [[package]] name = "leftwm-theme" -version = "0.1.1" +version = "0.1.2-git" dependencies = [ "clap", "colored", @@ -637,6 +637,7 @@ dependencies = [ "git2", "leftwm-core", "log", + "openssl-sys", "pretty_env_logger", "regex", "reqwest", @@ -840,6 +841,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "111.27.0+1.1.1v" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e8f197c82d7511c5b014030c9b1efeda40d7d5f99d23b4ceed3524a5e63f02" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.91" @@ -848,6 +858,7 @@ checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -1111,18 +1122,18 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.182" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb30a74471f5b7a1fa299f40b4bf1be93af61116df95465b2b5fc419331e430" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.182" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4c2c6ea4bc09b5c419012eafcdb0fcef1d9119d626c8f3a0708a5b92d38a70" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", @@ -1226,9 +1237,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.7.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", "fastrand", diff --git a/Cargo.toml b/Cargo.toml index 5b816bb..299e6ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leftwm-theme" -version = "0.1.1" +version = "0.1.2-git" authors = ["Lex Childs ", "Hitesh Paul ", "Mautamu "] description = "A theme mangager for LeftWM" edition = "2018" @@ -8,6 +8,7 @@ keywords = ["leftwm", "wm", "theme"] license = "MIT" repository = "https://github.com/leftwm/leftwm-theme" readme = "README.md" +resolver="1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -32,3 +33,8 @@ tempfile = "3.2.0" toml = "0.5.5" xdg = "2.2.0" url = "2.2.2" + + +[dependencies.openssl-sys] +version = "0.9" +features = ["vendored"]