diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..b13917b --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,20 @@ +[target.x86_64-unknown-linux-musl] +linker = "x86_64-linux-gnu-gcc" +rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc"] + +[target.aarch64-unknown-linux-gnu] +linker = "aarch64-linux-gnu-gcc" + +[target.aarch64-unknown-linux-musl] +linker = "aarch64-linux-gnu-gcc" +rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc"] + +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" + +[target.armv7-unknown-linux-musleabihf] +linker = "arm-linux-gnueabihf-gcc" +rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc"] + +[target.x86_64-pc-windows-gnu] +linker = "x86_64-w64-mingw32-gcc" diff --git a/.woodpecker.yml b/.woodpecker.yml index 2af2f11..fa5f5e7 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -11,28 +11,39 @@ matrix: - TARGET: x86_64-unknown-linux-gnu ARTIFACT: owlen-linux-x86_64-gnu PLATFORM: linux + EXT: "" - TARGET: x86_64-unknown-linux-musl ARTIFACT: owlen-linux-x86_64-musl PLATFORM: linux + EXT: "" - TARGET: aarch64-unknown-linux-gnu ARTIFACT: owlen-linux-aarch64-gnu PLATFORM: linux + EXT: "" - TARGET: aarch64-unknown-linux-musl ARTIFACT: owlen-linux-aarch64-musl PLATFORM: linux + EXT: "" - TARGET: armv7-unknown-linux-gnueabihf ARTIFACT: owlen-linux-armv7-gnu PLATFORM: linux + EXT: "" - TARGET: armv7-unknown-linux-musleabihf ARTIFACT: owlen-linux-armv7-musl PLATFORM: linux + EXT: "" + # Windows + - TARGET: x86_64-pc-windows-gnu + ARTIFACT: owlen-windows-x86_64 + PLATFORM: windows + EXT: ".exe" steps: - name: install-deps image: *rust_image commands: - apt-get update - - apt-get install -y musl-tools gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf + - apt-get install -y musl-tools gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf gcc-mingw-w64-x86-64 zip - name: build image: *rust_image @@ -54,6 +65,9 @@ steps: export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc export CC_armv7_unknown_linux_musleabihf=arm-linux-gnueabihf-gcc ;; + x86_64-pc-windows-gnu) + export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc + ;; esac - cargo build --release --all-features --target ${TARGET} @@ -61,13 +75,24 @@ steps: image: *rust_image commands: - mkdir -p dist - - cp target/${TARGET}/release/owlen dist/owlen - - cp target/${TARGET}/release/owlen-code dist/owlen-code - - cd dist - - tar czf ${ARTIFACT}.tar.gz owlen owlen-code - - cd .. - - mv dist/${ARTIFACT}.tar.gz . - - sha256sum ${ARTIFACT}.tar.gz > ${ARTIFACT}.tar.gz.sha256 + - | + if [ "${PLATFORM}" = "windows" ]; then + cp target/${TARGET}/release/owlen.exe dist/owlen.exe + cp target/${TARGET}/release/owlen-code.exe dist/owlen-code.exe + cd dist + zip -9 ${ARTIFACT}.zip owlen.exe owlen-code.exe + cd .. + mv dist/${ARTIFACT}.zip . + sha256sum ${ARTIFACT}.zip > ${ARTIFACT}.zip.sha256 + else + cp target/${TARGET}/release/owlen dist/owlen + cp target/${TARGET}/release/owlen-code dist/owlen-code + cd dist + tar czf ${ARTIFACT}.tar.gz owlen owlen-code + cd .. + mv dist/${ARTIFACT}.tar.gz . + sha256sum ${ARTIFACT}.tar.gz > ${ARTIFACT}.tar.gz.sha256 + fi - name: release image: plugins/gitea-release @@ -78,5 +103,7 @@ steps: files: - ${ARTIFACT}.tar.gz - ${ARTIFACT}.tar.gz.sha256 + - ${ARTIFACT}.zip + - ${ARTIFACT}.zip.sha256 title: Release ${CI_COMMIT_TAG} note: "Release ${CI_COMMIT_TAG}" diff --git a/Cargo.toml b/Cargo.toml index c8caf91..0f07e15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ crossterm = "0.28" tui-textarea = "0.6" # HTTP client and JSON handling -reqwest = { version = "0.12", features = ["json", "stream"] } +reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0"