Skip to content

Commit

Permalink
perf: optimize build
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Nov 9, 2022
1 parent 60e55d3 commit cff4714
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ jobs:
os: ubuntu-latest
cross: false
file-ext: ""
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
cross: true
file-ext: ""
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: false
Expand All @@ -42,26 +38,10 @@ jobs:
os: macos-latest
cross: false
file-ext: ""
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
file-ext: ""
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
cross: true
file-ext: ""
- target: aarch64-apple-darwin
os: macos-latest
cross: true
file-ext: ""
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
cross: true
file-ext: ""
- target: armv7-unknown-linux-musleabihf
os: ubuntu-latest
cross: true
file-ext: ""

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -82,15 +62,15 @@ jobs:
continue-on-error: true
uses: svenstaro/upx-action@v2
with:
file: target/${{ matrix.target }}/release/simple-proxy${{ matrix.file-ext }}
file: target/${{ matrix.target }}/release/simple_proxy${{ matrix.file-ext }}
args: -q --best --lzma
strip: false
- name: pack
run: |
mkdir -p release-${{ matrix.target }}
cd release-${{ matrix.target }}
tar -C ../target/${{ matrix.target }}/release -zcf simple-proxy-${{ matrix.target }}.tar.gz simple-proxy${{ matrix.file-ext }}
openssl dgst -sha256 -r simple-proxy-${{ matrix.target }}.tar.gz > simple-proxy-${{ matrix.target }}.sha256
tar -C ../target/${{ matrix.target }}/release -zcf simple_proxy-${{ matrix.target }}.tar.gz simple_proxy${{ matrix.file-ext }}
openssl dgst -sha256 -r simple_proxy-${{ matrix.target }}.tar.gz > simple_proxy-${{ matrix.target }}.sha256
- name: release
uses: softprops/action-gh-release@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
[package]
name = "simple-proxy"
version = "0.1.0"
version = "0.1.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true

[[bin]]
name = "simple_proxy"
path = "src/main.rs"

[dependencies]
dotenvy = "0.15"
anyhow = "1"
Expand Down

0 comments on commit cff4714

Please sign in to comment.