From 9c4f7cbf21e673d48a94ba5a565fbba13f7941cd Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 17:41:27 +1000 Subject: [PATCH 01/13] change to musl-tools --- .github/workflows/rust.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9cc56c7..35b48d9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,10 +1,11 @@ name: Rust on: - push: - branches: ["master"] - pull_request: - branches: ["master"] + push + # push: + # branches: ["master"] + # pull_request: + # branches: ["master"] env: CARGO_TERM_COLOR: always @@ -17,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install musl - run: sudo apt install -y musl-gcc + run: sudo apt install -y musl-tools # - name: Build # run: cargo build --verbose # - name: Run tests From 4040d12030cb89b862592e6a6ab6d7d8119a0c86 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 17:44:08 +1000 Subject: [PATCH 02/13] set openssl dir --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 35b48d9..3efbe1d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,6 +10,7 @@ on: env: CARGO_TERM_COLOR: always PKG_CONFIG_SYSROOT_DIR: / + OPENSSL_DIR: /usr/local/ssl jobs: build: From 73000f52a919f482671c817169e9ced245fcf315 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 17:50:23 +1000 Subject: [PATCH 03/13] update --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3efbe1d..eca9b6e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,7 +10,7 @@ on: env: CARGO_TERM_COLOR: always PKG_CONFIG_SYSROOT_DIR: / - OPENSSL_DIR: /usr/local/ssl + OPENSSL_INCLUDE_DIR: /usr/include/openssl jobs: build: From 29b01e04662f3f2be71435b7c2558ba10f2635be Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 17:55:13 +1000 Subject: [PATCH 04/13] update --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index eca9b6e..fece114 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,8 +9,8 @@ on: env: CARGO_TERM_COLOR: always - PKG_CONFIG_SYSROOT_DIR: / - OPENSSL_INCLUDE_DIR: /usr/include/openssl + # PKG_CONFIG_SYSROOT_DIR: / + # OPENSSL_INCLUDE_DIR: /usr/include/openssl jobs: build: From 37600d94039d253ecf24b4f0797cc4d85d1fbbe5 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:32:20 +1000 Subject: [PATCH 05/13] update --- Cargo.lock | 283 +++++++++++++++++------------------------------------ Cargo.toml | 4 +- 2 files changed, 90 insertions(+), 197 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 669ea07..11b14e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,16 +233,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -375,15 +365,6 @@ dependencies = [ "libc", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "filetime" version = "0.2.21" @@ -392,7 +373,7 @@ checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "windows-sys 0.48.0", ] @@ -412,21 +393,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.1.0" @@ -687,16 +653,16 @@ dependencies = [ ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-rustls" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ - "bytes", + "http", "hyper", - "native-tls", + "rustls", "tokio", - "tokio-native-tls", + "tokio-rustls", ] [[package]] @@ -743,15 +709,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-lifetimes" version = "1.0.10" @@ -899,24 +856,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -959,7 +898,6 @@ dependencies = [ [[package]] name = "oci-distribution" version = "0.10.0" -source = "git+https://github.com/lswith/oci-distribution.git?branch=next#42f626af099b9e7c2ade4eb804a5038eddc069f3" dependencies = [ "chrono", "futures", @@ -1019,50 +957,6 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "openssl" -version = "0.10.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ea2d98598bf9ada7ea6ee8a30fb74f9156b63bbe495d64ec2b87c269d2dda3" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992bac49bdbab4423199c654a5515bd2a6c6a23bf03f2dd3bdb7e5ae6259bc69" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "overload" version = "0.1.1" @@ -1087,7 +981,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "windows-sys 0.45.0", ] @@ -1110,12 +1004,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1185,15 +1073,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - [[package]] name = "regex" version = "1.8.1" @@ -1241,20 +1120,21 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-tls", + "hyper-rustls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-native-tls", + "tokio-rustls", "tokio-util", "tower-service", "url", @@ -1262,9 +1142,25 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots", "winreg", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rustix" version = "0.37.14" @@ -1280,20 +1176,32 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.13" +name = "rustls" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] [[package]] -name = "schannel" -version = "0.1.21" +name = "rustls-pemfile" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "windows-sys 0.42.0", + "base64 0.21.0", ] +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + [[package]] name = "scopeguard" version = "1.1.0" @@ -1307,26 +1215,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] -name = "security-framework" -version = "2.8.2" +name = "sct" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" -dependencies = [ - "core-foundation-sys", - "libc", + "ring", + "untrusted", ] [[package]] @@ -1426,6 +1321,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "strsim" version = "0.10.0" @@ -1471,19 +1372,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "tempfile" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys 0.45.0", -] - [[package]] name = "termcolor" version = "1.2.0" @@ -1580,13 +1468,14 @@ dependencies = [ ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "tokio-rustls" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "native-tls", + "rustls", "tokio", + "webpki", ] [[package]] @@ -1735,6 +1624,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -1758,12 +1653,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" @@ -1881,6 +1770,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1921,21 +1829,6 @@ dependencies = [ "windows-targets 0.48.0", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" diff --git a/Cargo.toml b/Cargo.toml index f4c7440..4796166 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ clap = { version = "4.2.4", features = ["cargo", "derive", "env"] } clap-markdown = "0.1.3" flate2 = "1.0.25" futures = "0.3.28" -oci-distribution = { git = "https://github.com/lswith/oci-distribution.git", branch = "next" } -# oci-distribution = { path = "../oci-distribution" } +oci-distribution = { git = "https://github.com/lswith/oci-distribution.git", branch = "next", default-features = false, features = ["rustls-tls"]} +# oci-distribution = { path = "../oci-distribution" , default-features = false, features = ["rustls-tls"]} rand = "0.8.5" serde = "1.0.160" serde_json = "1.0.96" From 066eb9581faeb748b8ef66334215f1affb89d874 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:34:33 +1000 Subject: [PATCH 06/13] update --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index 11b14e8..68d81c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -898,6 +898,7 @@ dependencies = [ [[package]] name = "oci-distribution" version = "0.10.0" +source = "git+https://github.com/lswith/oci-distribution.git?branch=next#42f626af099b9e7c2ade4eb804a5038eddc069f3" dependencies = [ "chrono", "futures", From cb2f8439c03196033f2b5d7c90c8fa287c2df531 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:40:52 +1000 Subject: [PATCH 07/13] update workflows --- .github/workflows/rust.yml | 79 +++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fece114..7a781d8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,8 +9,6 @@ on: env: CARGO_TERM_COLOR: always - # PKG_CONFIG_SYSROOT_DIR: / - # OPENSSL_INCLUDE_DIR: /usr/include/openssl jobs: build: @@ -18,15 +16,78 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install musl - run: sudo apt install -y musl-tools - # - name: Build - # run: cargo build --verbose - # - name: Run tests - # run: cargo test --verbose + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + + cross: + name: Release - ${{ matrix.platform.release_for }} + strategy: + matrix: + platform: + - release_for: Linux-x86_64 + os: ubuntu-latest + target: x86_64-unknown-linux-musl + bin: oci-tester + name: oci-tester-Linux-x86_64-musl.tar.gz + + - release_for: Linux-aarch64 + os: ubuntu-latest + target: aarch64-unknown-linux-musl + bin: oci-tester + name: oci-tester-Linux-aarch64-musl.tar.gz + + - release_for: Linux-arm + os: ubuntu-latest + target: arm-unknown-linux-musleabi + bin: oci-tester + name: oci-tester-Linux-arm-musl.tar.gz + + - release_for: Windows-i686 + os: windows-latest + target: i686-pc-windows-msvc + bin: oci-tester.exe + name: oci-tester-Windows-i686.zip + + - release_for: Windows-x86_64 + os: windows-latest + target: x86_64-pc-windows-msvc + bin: oci-tester.exe + name: oci-tester-Windows-x86_64.zip + + - release_for: macOS-x86_64 + os: macOS-latest + target: x86_64-apple-darwin + bin: oci-tester + name: oci-tester-Darwin-x86_64.tar.gz + + - release_for: macOS-aarch64 + os: macOS-latest + target: aarch64-apple-darwin + bin: oci-tester + name: oci-tester-Darwin-aarch64.tar.gz + + runs-on: ${{ matrix.platform.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 - name: Build binary uses: houseabsolute/actions-rust-cross@v0 with: - target: x86_64-unknown-linux-musl + target: ${{ matrix.platform.target }} args: "--locked --release" strip: true + - name: Package as archive + shell: bash + run: | + cd target/${{ matrix.platform.target }}/release + if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then + 7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} + else + tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} + fi + cd - + - name: Generate SHA-256 + if: matrix.platform.os == 'macOS-latest' + run: shasum -a 256 ${{ matrix.platform.name }} From a3a895f5ae7859f938a4de3af463051c0e1ad0b2 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:43:11 +1000 Subject: [PATCH 08/13] test faster --- .github/workflows/rust.yml | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7a781d8..2ecef86 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + # - name: Build + # run: cargo build --verbose + # - name: Run tests + # run: cargo test --verbose cross: name: Release - ${{ matrix.platform.release_for }} @@ -44,29 +44,29 @@ jobs: bin: oci-tester name: oci-tester-Linux-arm-musl.tar.gz - - release_for: Windows-i686 - os: windows-latest - target: i686-pc-windows-msvc - bin: oci-tester.exe - name: oci-tester-Windows-i686.zip - - - release_for: Windows-x86_64 - os: windows-latest - target: x86_64-pc-windows-msvc - bin: oci-tester.exe - name: oci-tester-Windows-x86_64.zip - - - release_for: macOS-x86_64 - os: macOS-latest - target: x86_64-apple-darwin - bin: oci-tester - name: oci-tester-Darwin-x86_64.tar.gz - - - release_for: macOS-aarch64 - os: macOS-latest - target: aarch64-apple-darwin - bin: oci-tester - name: oci-tester-Darwin-aarch64.tar.gz + # - release_for: Windows-i686 + # os: windows-latest + # target: i686-pc-windows-msvc + # bin: oci-tester.exe + # name: oci-tester-Windows-i686.zip + # + # - release_for: Windows-x86_64 + # os: windows-latest + # target: x86_64-pc-windows-msvc + # bin: oci-tester.exe + # name: oci-tester-Windows-x86_64.zip + # + # - release_for: macOS-x86_64 + # os: macOS-latest + # target: x86_64-apple-darwin + # bin: oci-tester + # name: oci-tester-Darwin-x86_64.tar.gz + # + # - release_for: macOS-aarch64 + # os: macOS-latest + # target: aarch64-apple-darwin + # bin: oci-tester + # name: oci-tester-Darwin-aarch64.tar.gz runs-on: ${{ matrix.platform.os }} steps: From 6dc1dc4b099b13f505de3b7a921bf1e48fdbc101 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:45:25 +1000 Subject: [PATCH 09/13] install musl tools --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2ecef86..d55b5f9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -72,6 +72,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Install musl-tools + run: sudo apt install -y musl-tools + if: matrix.platform.os == 'ubuntu-latest' - name: Build binary uses: houseabsolute/actions-rust-cross@v0 with: From ffd891cd2ad5dbfb426193e1f86dc85fe9517f1b Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:50:25 +1000 Subject: [PATCH 10/13] turn on mac --- .github/workflows/rust.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d55b5f9..b06e814 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -56,17 +56,17 @@ jobs: # bin: oci-tester.exe # name: oci-tester-Windows-x86_64.zip # - # - release_for: macOS-x86_64 - # os: macOS-latest - # target: x86_64-apple-darwin - # bin: oci-tester - # name: oci-tester-Darwin-x86_64.tar.gz - # - # - release_for: macOS-aarch64 - # os: macOS-latest - # target: aarch64-apple-darwin - # bin: oci-tester - # name: oci-tester-Darwin-aarch64.tar.gz + - release_for: macOS-x86_64 + os: macOS-latest + target: x86_64-apple-darwin + bin: oci-tester + name: oci-tester-Darwin-x86_64.tar.gz + + - release_for: macOS-aarch64 + os: macOS-latest + target: aarch64-apple-darwin + bin: oci-tester + name: oci-tester-Darwin-aarch64.tar.gz runs-on: ${{ matrix.platform.os }} steps: From 654590e9e5f6236786e631a2f742fd0bac7158f7 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:52:35 +1000 Subject: [PATCH 11/13] enable windows --- .github/workflows/rust.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b06e814..46a847a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,18 +44,18 @@ jobs: bin: oci-tester name: oci-tester-Linux-arm-musl.tar.gz - # - release_for: Windows-i686 - # os: windows-latest - # target: i686-pc-windows-msvc - # bin: oci-tester.exe - # name: oci-tester-Windows-i686.zip - # - # - release_for: Windows-x86_64 - # os: windows-latest - # target: x86_64-pc-windows-msvc - # bin: oci-tester.exe - # name: oci-tester-Windows-x86_64.zip - # + - release_for: Windows-i686 + os: windows-latest + target: i686-pc-windows-msvc + bin: oci-tester.exe + name: oci-tester-Windows-i686.zip + + - release_for: Windows-x86_64 + os: windows-latest + target: x86_64-pc-windows-msvc + bin: oci-tester.exe + name: oci-tester-Windows-x86_64.zip + - release_for: macOS-x86_64 os: macOS-latest target: x86_64-apple-darwin From 8e8b1e56b2b130955a849fa1f52238ec831af4eb Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:54:11 +1000 Subject: [PATCH 12/13] enable release job --- .github/workflows/release.yaml | 178 +++++++++++++++------------------ 1 file changed, 83 insertions(+), 95 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b70082a..fc2804e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,97 +1,85 @@ -# name: release -# on: -# push: -# tags: -# - "v*" -# jobs: -# publish: -# name: publish to crates.io -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# # - name: publish oci-tester to crates.io -# # run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} +on: + release: + types: [created] -# on: -# push -# release: -# types: [created] +jobs: + release: + name: Release - ${{ matrix.platform.release_for }} + strategy: + matrix: + platform: + - release_for: Linux-x86_64 + os: ubuntu-latest + target: x86_64-unknown-linux-musl + bin: oci-tester + name: oci-tester-Linux-x86_64-musl.tar.gz -# jobs: -# release: -# name: Release - ${{ matrix.platform.release_for }} -# strategy: -# matrix: -# platform: -# - release_for: Linux-x86_64 -# os: ubuntu-latest -# target: x86_64-unknown-linux-musl -# bin: oci-tester -# name: oci-tester-Linux-x86_64-musl.tar.gz -# -# - release_for: Linux-aarch64 -# os: ubuntu-latest -# target: aarch64-unknown-linux-musl -# bin: oci-tester -# name: oci-tester-Linux-aarch64-musl.tar.gz -# -# - release_for: Linux-arm -# os: ubuntu-latest -# target: arm-unknown-linux-musleabi -# bin: oci-tester -# name: oci-tester-Linux-arm-musl.tar.gz -# -# - release_for: Windows-i686 -# os: windows-latest -# target: i686-pc-windows-msvc -# bin: oci-tester.exe -# name: oci-tester-Windows-i686.zip -# -# - release_for: Windows-x86_64 -# os: windows-latest -# target: x86_64-pc-windows-msvc -# bin: oci-tester.exe -# name: oci-tester-Windows-x86_64.zip -# -# - release_for: macOS-x86_64 -# os: macOS-latest -# target: x86_64-apple-darwin -# bin: oci-tester -# name: oci-tester-Darwin-x86_64.tar.gz -# -# - release_for: macOS-aarch64 -# os: macOS-latest -# target: aarch64-apple-darwin -# bin: oci-tester -# name: oci-tester-Darwin-aarch64.tar.gz -# -# runs-on: ${{ matrix.platform.os }} -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# - name: Build binary -# uses: houseabsolute/actions-rust-cross@v0 -# with: -# target: ${{ matrix.platform.target }} -# args: "--locked --release" -# strip: true -# - name: Package as archive -# shell: bash -# run: | -# cd target/${{ matrix.platform.target }}/release -# if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then -# 7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} -# else -# tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} -# fi -# cd - -# - name: Generate SHA-256 -# if: matrix.platform.os == 'macOS-latest' -# run: shasum -a 256 ${{ matrix.platform.name }} -# - name: Publish GitHub release -# uses: softprops/action-gh-release@v1 -# with: -# files: "oci-tester-*" -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# if: startsWith( github.ref, 'refs/tags/v' ) + - release_for: Linux-aarch64 + os: ubuntu-latest + target: aarch64-unknown-linux-musl + bin: oci-tester + name: oci-tester-Linux-aarch64-musl.tar.gz + + - release_for: Linux-arm + os: ubuntu-latest + target: arm-unknown-linux-musleabi + bin: oci-tester + name: oci-tester-Linux-arm-musl.tar.gz + + - release_for: Windows-i686 + os: windows-latest + target: i686-pc-windows-msvc + bin: oci-tester.exe + name: oci-tester-Windows-i686.zip + + - release_for: Windows-x86_64 + os: windows-latest + target: x86_64-pc-windows-msvc + bin: oci-tester.exe + name: oci-tester-Windows-x86_64.zip + + - release_for: macOS-x86_64 + os: macOS-latest + target: x86_64-apple-darwin + bin: oci-tester + name: oci-tester-Darwin-x86_64.tar.gz + + - release_for: macOS-aarch64 + os: macOS-latest + target: aarch64-apple-darwin + bin: oci-tester + name: oci-tester-Darwin-aarch64.tar.gz + + runs-on: ${{ matrix.platform.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install musl-tools + run: sudo apt install -y musl-tools + if: matrix.platform.os == 'ubuntu-latest' + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + target: ${{ matrix.platform.target }} + args: "--locked --release" + strip: true + - name: Package as archive + shell: bash + run: | + cd target/${{ matrix.platform.target }}/release + if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then + 7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} + else + tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} + fi + cd - + - name: Generate SHA-256 + if: matrix.platform.os == 'macOS-latest' + run: shasum -a 256 ${{ matrix.platform.name }} + - name: Publish GitHub release + uses: softprops/action-gh-release@v1 + with: + files: "oci-tester-*" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: startsWith( github.ref, 'refs/tags/v' ) From 3a463a07f5af3e52b8e8f2ba698e7611683fe5e6 Mon Sep 17 00:00:00 2001 From: Luke Swithenbank Date: Mon, 24 Apr 2023 18:56:13 +1000 Subject: [PATCH 13/13] update build workflow --- .github/workflows/rust.yml | 93 ++++---------------------------------- 1 file changed, 9 insertions(+), 84 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 46a847a..5c3e1c2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,96 +1,21 @@ name: Rust on: - push - # push: - # branches: ["master"] - # pull_request: - # branches: ["master"] + push: + branches: ["master"] + pull_request: + branches: ["master"] env: CARGO_TERM_COLOR: always jobs: - build: + buildtest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - name: Build - # run: cargo build --verbose - # - name: Run tests - # run: cargo test --verbose - - cross: - name: Release - ${{ matrix.platform.release_for }} - strategy: - matrix: - platform: - - release_for: Linux-x86_64 - os: ubuntu-latest - target: x86_64-unknown-linux-musl - bin: oci-tester - name: oci-tester-Linux-x86_64-musl.tar.gz - - - release_for: Linux-aarch64 - os: ubuntu-latest - target: aarch64-unknown-linux-musl - bin: oci-tester - name: oci-tester-Linux-aarch64-musl.tar.gz - - - release_for: Linux-arm - os: ubuntu-latest - target: arm-unknown-linux-musleabi - bin: oci-tester - name: oci-tester-Linux-arm-musl.tar.gz - - - release_for: Windows-i686 - os: windows-latest - target: i686-pc-windows-msvc - bin: oci-tester.exe - name: oci-tester-Windows-i686.zip - - - release_for: Windows-x86_64 - os: windows-latest - target: x86_64-pc-windows-msvc - bin: oci-tester.exe - name: oci-tester-Windows-x86_64.zip - - - release_for: macOS-x86_64 - os: macOS-latest - target: x86_64-apple-darwin - bin: oci-tester - name: oci-tester-Darwin-x86_64.tar.gz - - - release_for: macOS-aarch64 - os: macOS-latest - target: aarch64-apple-darwin - bin: oci-tester - name: oci-tester-Darwin-aarch64.tar.gz - - runs-on: ${{ matrix.platform.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install musl-tools - run: sudo apt install -y musl-tools - if: matrix.platform.os == 'ubuntu-latest' - - name: Build binary - uses: houseabsolute/actions-rust-cross@v0 - with: - target: ${{ matrix.platform.target }} - args: "--locked --release" - strip: true - - name: Package as archive - shell: bash - run: | - cd target/${{ matrix.platform.target }}/release - if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then - 7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} - else - tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} - fi - cd - - - name: Generate SHA-256 - if: matrix.platform.os == 'macOS-latest' - run: shasum -a 256 ${{ matrix.platform.name }} + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose