Skip to content

Commit

Permalink
chore(ci): update goreleaser post script
Browse files Browse the repository at this point in the history
  • Loading branch information
luizfonseca committed May 13, 2024
1 parent be17f63 commit d3a40a4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
7 changes: 5 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

15 changes: 8 additions & 7 deletions build-cross-release.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d3a40a4

Please sign in to comment.