diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 2511d11..d9ef1e9 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,13 +6,16 @@ builds: binary: proksi hooks: post: sh build-cross-release.sh + targets: + - linux_amd64_v1 + - darwin_amd64_v1 archives: - id: tar.gz format: tar.gz - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }}' + name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}' - id: binary format: binary - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }}' + name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}' checksum: name_template: 'checksums.txt' release: diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b3450cc..0000000 --- a/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM rust:slim-buster -RUN apt-get update && apt-get install -y libssl-dev pkg-config -WORKDIR /app - - -RUN rustup target add x86_64-unknown-linux-musl -RUN rustup target add x86_64-unknown-linux-gnu - - -RUN cargo build --release --target x86_64-unknown-linux-musl diff --git a/build-cross-release.sh b/build-cross-release.sh index 5377f92..83b49c4 100755 --- a/build-cross-release.sh +++ b/build-cross-release.sh @@ -1,9 +1,10 @@ -# rustup target add x86_64-apple-darwin -# rustup target add x86_64-unknown-linux-gnu -# rustup target add aarch64-apple-darwin +cargo install cross --git https://github.com/cross-rs/cross -docker run --rm -v `pwd`:/app rust:slim-buster sh -c 'cd /app rustup target x86_64-unknown-linux-gnu && cargo build --release --target=x86_64-unknown-linux-gnu --bin proksi' -cargo build --release --target=aarch64-apple-darwin --bin proksi +cross build --release --target=x86_64-unknown-linux-gnu +cross build --release --target=x86_64-apple-darwin -mkdir -p dist/darwin_amd64 && cp target/x86_64-apple-darwin/release/proksi dist/darwin_amd64 -mkdir -p dist/linux_amd64 && cp target/x86_64-unknown-linux-gnu/release/proksi dist/linux_amd64 +mkdir -p dist/proksi_darwin_amd64_v1 +mkdir -p dist/proksi_linux_amd64_v1 + +cp target/x86_64-apple-darwin/release/proksi dist/proksi_darwin_amd64 +cp target/x86_64-unknown-linux-gnu/release/proksi dist/proksi_linux_amd64_v1 diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000..6da9bc3 --- /dev/null +++ b/clippy.toml @@ -0,0 +1,5 @@ +disallowed-methods = [ + { path = "std::path::Path::display", reason = "incorrect handling of non-Unicode paths, use path.to_utf8() or debug (`{path:?}`) instead" }, +] +allow-unwrap-in-tests = true +msrv = "1.78.0" diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..b421716 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,10 @@ +condense_wildcard_suffixes = true +brace_style = "PreferSameLine" +fn_single_line = true +where_single_line = true +use_field_init_shorthand = true +reorder_impl_items = true +edition = "2021" +reorder_imports = true +newline_style = "Unix" +format_code_in_doc_comments = true