Go back to vendored ssl for aarch64-linux #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CD | |
on: | |
push: | |
pull_request: | |
jobs: | |
publish: | |
name: Publishing for ${{ matrix.job.os }} | |
runs-on: ${{ matrix.job.os }} | |
strategy: | |
matrix: | |
rust: [stable] | |
job: | |
- os: macos-latest | |
os-name: macos | |
target: x86_64-apple-darwin | |
architecture: x86_64 | |
- os: macos-14 | |
os-name: macos | |
target: aarch64-apple-darwin | |
architecture: arm64 | |
- os: ubuntu-latest | |
os-name: linux | |
target: x86_64-unknown-linux-gnu | |
architecture: x86_64 | |
- os: windows-latest | |
os-name: windows | |
target: x86_64-pc-windows-msvc | |
architecture: x86_64 | |
- os: ubuntu-latest | |
os-name: linux | |
target: aarch64-unknown-linux-gnu | |
architecture: arm64 | |
steps: | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
target: ${{ matrix.job.target }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: install cross-compilation tools | |
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} | |
run: | | |
sudo apt update | |
sudo apt-get install -y binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu | |
echo CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc >> $GITHUB_ENV | |
- name: Cargo build | |
run: | | |
cargo build --release --target ${{ matrix.job.target }} | |
- name: Packaging final binary | |
shell: bash | |
run: | | |
cd target/"${{ matrix.job.target }}"/release | |
####### reduce binary size by removing debug symbols ####### | |
BINARY_NAME=hc-runner${{ matrix.job.os-name == 'windows' && '.exe' || '' }} | |
if [[ "${{ matrix.job.target }}" == aarch64-unknown-linux-gnu ]]; then | |
GCC_PREFIX="aarch64-linux-gnu-" | |
else | |
GCC_PREFIX="" | |
fi | |
"$GCC_PREFIX"strip $BINARY_NAME | |
########## create tar.gz ########## | |
# For releases, ref_name will be something like `v1.2.3`, but we want to make sure the | |
# packaging is also working for non-release runs, using something like `branchname`. | |
REFNAME=${{ github.ref_name }} | |
# Avoid issues with refnames that have slashes, like `hc-runner-dependabot/cargo/h2-0.3.26` | |
REFNAME=${REFNAME//\//-} | |
RELEASE_NAME="hc-runner-${REFNAME}-${{ matrix.job.os-name }}-${{ matrix.job.architecture }}" | |
tar czvf "$RELEASE_NAME.tar.gz" "$BINARY_NAME" | |
########## create sha256 ########## | |
if [[ "${{ runner.os }}" == 'Windows' ]]; then | |
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256 | |
else | |
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256 | |
fi | |
- name: Releasing assets | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
target/${{ matrix.job.target }}/release/hc-runner-*.tar.gz | |
target/${{ matrix.job.target }}/release/hc-runner-*.sha256 | |
publish-cargo: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Publishing to Cargo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: cargo publish --token "${{ secrets.HC_RUNNER_CARGO_PUBLISH_TOKEN }}" |