Skip to content

Commit

Permalink
release: support more arm architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 6, 2023
1 parent d6ee86e commit 8c07c33
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 57 deletions.
90 changes: 43 additions & 47 deletions .github/workflows/rtx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,58 +81,55 @@ jobs:
fail_ci_if_error: false
files: lcov.info

build-linux:
name: build-${{matrix.target}}
runs-on: ubuntu-22.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- arm-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "build-linux-${{matrix.target}}"
save-if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- uses: taiki-e/install-action@cross
- run: scripts/setup-zipsign.sh
env:
ZIPSIGN: ${{ secrets.ZIPSIGN }}
- run: scripts/build-tarball.sh rtx --release --features openssl/vendored --target ${{matrix.target}}
env:
CROSS: "1"
- uses: actions/upload-artifact@v3
with:
name: tarball-${{matrix.target}}
path: |
dist/rtx-*.tar.xz
dist/rtx-*.tar.gz
if-no-files-found: error

build-macos:
name: build-${{matrix.target}}
runs-on: macos-12
build-tarball:
name: build-tarball-${{matrix.name}}
runs-on: ${{matrix.os}}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
include:
- os: ubuntu-22.04
name: linux-x64
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04
name: linux-x64-musl
target: aarch64-unknown-linux-musl
- os: ubuntu-22.04
name: linux-arm64
target: aarch64-unknown-linux-gnu
- os: ubuntu-22.04
name: linux-arm64-musl
target: aarch64-unknown-linux-musl
- os: ubuntu-22.04
name: linux-armv7
target: armv7-unknown-linux-gnueabi
- os: ubuntu-22.04
name: linux-armv7-musl
target: armv7-unknown-linux-musleabi
- os: ubuntu-22.04
name: linux-armv6
target: arm-unknown-linux-gnueabi
- os: ubuntu-22.04
name: linux-armv6-musl
target: arm-unknown-linux-musleabi
- os: macos-12
name: macos-x64
target: x86_64-apple-darwin
- os: macos-12
name: macos-arm64
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- run: rustup target add ${{matrix.target}}
- if: matrix.os == 'macos-12'
run: rustup target add ${{matrix.target}}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: "${{matrix.target}}"
shared-key: "build-tarball-${{matrix.name}}"
save-if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- if: matrix.os == 'ubuntu-22.04'
uses: taiki-e/install-action@cross
- run: scripts/setup-zipsign.sh
env:
ZIPSIGN: ${{ secrets.ZIPSIGN }}
Expand All @@ -147,7 +144,7 @@ jobs:
e2e-linux:
runs-on: ubuntu-22.04
#container: ghcr.io/jdx/rtx:github-actions
needs: [build-linux]
needs: [build-tarball]
timeout-minutes: 30
if: github.event_name != 'pull_request'
steps:
Expand All @@ -171,7 +168,7 @@ jobs:
command: ./e2e/run_all_tests
rpm:
runs-on: ubuntu-22.04
needs: [build-linux]
needs: [build-tarball]
timeout-minutes: 10
container: ghcr.io/jdx/rtx:rpm
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -199,7 +196,7 @@ jobs:
container: ghcr.io/jdx/rtx:deb
timeout-minutes: 10
if: github.event_name != 'pull_request'
needs: [build-linux]
needs: [build-tarball]
steps:
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-import-gpg@v6
Expand Down Expand Up @@ -230,8 +227,7 @@ jobs:
- unit
- coverage
- e2e-linux
- build-linux
- build-macos
- build-tarball
- rpm
- deb
steps:
Expand Down
14 changes: 12 additions & 2 deletions scripts/build-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,23 @@ get_arch() {
;;
esac
}
get_suffix() {
case "$RUST_TRIPLE" in
*-musl | *-musleabi | *-musleabihf)
echo "-musl"
;;
*)
echo ""
;;
esac
}
#endregion

set -x
VERSION=$(./scripts/get-version.sh)
BASENAME=$NAME-$VERSION-$(get_os)-$(get_arch)
BASENAME=$NAME-$VERSION-$(get_os)-$(get_arch)$(get_suffix)

if [ "${CROSS:-}" = "1" ]; then
if command -v cross >/dev/null; then
cross build "$@"
else
cargo build "$@"
Expand Down
4 changes: 4 additions & 0 deletions scripts/release-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ dist_tag="$(dist_tag_from_version "$RTX_VERSION")"

platforms=(
linux-x64
linux-x64-musl
linux-arm64
linux-arm64-musl
linux-armv6
linux-armv6-musl
linux-armv7
linux-armv7-musl
macos-x64
macos-arm64
)
Expand Down
13 changes: 5 additions & 8 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ export RTX_VERSION RELEASE_DIR
rm -rf "${RELEASE_DIR:?}/$RTX_VERSION"
mkdir -p "$RELEASE_DIR/$RTX_VERSION"

targets=(
x86_64-unknown-linux-gnu
aarch64-unknown-linux-gnu
arm-unknown-linux-gnueabihf
armv7-unknown-linux-gnueabihf
x86_64-apple-darwin
aarch64-apple-darwin
)
targets=$(find artifacts -name 'tarball-*' -exec basename {} \; | sed 's/^tarball-//')
for target in "${targets[@]}"; do
cp "artifacts/tarball-$target/"*.tar.gz "$RELEASE_DIR/$RTX_VERSION"
cp "artifacts/tarball-$target/"*.tar.xz "$RELEASE_DIR/$RTX_VERSION"
done

platforms=(
linux-x64
linux-x64-musl
linux-arm64
linux-arm64-musl
linux-armv6
linux-armv6-musl
linux-armv7
linux-armv7-musl
macos-x64
macos-arm64
)
Expand Down
4 changes: 4 additions & 0 deletions scripts/render-homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ set -euxo pipefail
# shellcheck disable=SC2016
RTX_VERSION=${RTX_VERSION#v*} \
RTX_CHECKSUM_LINUX_X86_64=$(grep "rtx-v$RTX_VERSION-linux-x64.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_X86_64_MUSL=$(grep "rtx-v$RTX_VERSION-linux-x64-musl.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_ARM64=$(grep "rtx-v$RTX_VERSION-linux-arm64.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_ARM64_MUSL=$(grep "rtx-v$RTX_VERSION-linux-arm64-musl.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_ARMV6=$(grep "rtx-v$RTX_VERSION-linux-armv6.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_ARMV6_MUSL=$(grep "rtx-v$RTX_VERSION-linux-armv6-musl.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_ARMV7=$(grep "rtx-v$RTX_VERSION-linux-armv7.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_LINUX_ARMV7_MUSL=$(grep "rtx-v$RTX_VERSION-linux-armv7-musl.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_MACOS_X86_64=$(grep "rtx-v$RTX_VERSION-macos-x64.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
RTX_CHECKSUM_MACOS_ARM64=$(grep "rtx-v$RTX_VERSION-macos-arm64.tar.xz" "$RELEASE_DIR/v$RTX_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \
envsubst '$RTX_VERSION,$RTX_CHECKSUM_LINUX_X86_64,$RTX_CHECKSUM_LINUX_ARM64,$RTX_CHECKSUM_MACOS_X86_64,$RTX_CHECKSUM_MACOS_ARM64' \
Expand Down
4 changes: 4 additions & 0 deletions scripts/render-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ set -euxo pipefail
# shellcheck disable=SC2016
RTX_VERSION=$RTX_VERSION \
RTX_CHECKSUM_LINUX_X86_64=$(grep "rtx-v.*linux-x64.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_X86_64_MUSL=$(grep "rtx-v.*linux-x64-musl.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_ARM64=$(grep "rtx-v.*linux-arm64.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_ARM64_MUSL=$(grep "rtx-v.*linux-arm64-musl.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_ARMV6=$(grep "rtx-v.*linux-armv6.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_ARMV6_MUSL=$(grep "rtx-v.*linux-armv6-musl.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_ARMV7=$(grep "rtx-v.*linux-armv7.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_LINUX_ARMV7_MUSL=$(grep "rtx-v.*linux-armv7-musl.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_MACOS_X86_64=$(grep "rtx-v.*macos-x64.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
RTX_CHECKSUM_MACOS_ARM64=$(grep "rtx-v.*macos-arm64.tar.gz" "$RELEASE_DIR/$RTX_VERSION/SHASUMS256.txt") \
envsubst '$RTX_VERSION,$RTX_CHECKSUM_LINUX_X86_64,$RTX_CHECKSUM_LINUX_ARM64,$RTX_CHECKSUM_MACOS_X86_64,$RTX_CHECKSUM_MACOS_ARM64' \
Expand Down

0 comments on commit 8c07c33

Please sign in to comment.