Skip to content

Commit 290ff05

Browse files
committed
Publish individual bins for Linux-arm64
1 parent 181b247 commit 290ff05

1 file changed

Lines changed: 51 additions & 31 deletions

File tree

.github/workflows/CICD.yml

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ jobs:
265265
build_makefile:
266266
name: Build/Makefile
267267
needs: [ min_version, deps ]
268+
permissions:
269+
contents: write # Publish individual arm binaries instead of discarding
268270
runs-on: ${{ matrix.job.os }}
269271
env:
270272
SCCACHE_GHA_ENABLED: "true"
@@ -297,10 +299,6 @@ jobs:
297299
if [[ -d target ]]; then
298300
mv -T target target.cache
299301
fi
300-
# Check that we don't cross-build uudoc
301-
env CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu make install-manpages PREFIX=/tmp/usr UTILS=true
302-
# We don't build coreutils without MULTICALL=y
303-
! test -e target/debug/coreutils
304302
# build (host)
305303
make build
306304
echo "Check that target directory will be ignored by backup tools"
@@ -322,37 +320,56 @@ jobs:
322320
disable_search: true
323321
flags: makefile,${{ matrix.job.os }}
324322
fail_ci_if_error: false
325-
- name: "`make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n`"
323+
- name: "`make install PROG_PREFIX=uu- CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu PROFILE=release COMPLETIONS=n MANPAGES=n LOCALES=n`"
326324
shell: bash
327325
run: |
328326
set -x
329-
DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n
330-
# Check that utils are built with given profile
331-
./target/release-small/true
332-
# Check that the progs have prefix
333-
test -f /tmp/usr/local/bin/uu-tty
334-
test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.*
327+
sudo apt-get install -y gcc-aarch64-linux-gnu
328+
RUSTFLAGS="${RUSTFLAGS} -C strip=symbols"
329+
export RUSTFLAGS
330+
# Check that we don't cross-build uudoc. We don't full build just for it
331+
env CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu make install-manpages PREFIX=/tmp/usr UTILS=true
332+
test -f /tmp/usr/share/man/man1/true.1
333+
DESTDIR=/tmp/ make install CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu PROG_PREFIX=uu- PROFILE=release COMPLETIONS=n MANPAGES=n LOCALES=n
334+
# We don't build coreutils without MULTICALL=y
335+
! test -e target/aarch64-unknown-linux-gnu/release/coreutils
336+
# Check that the progs are missing prefix
337+
test -f /tmp/usr/local/bin/tty
338+
test -f /tmp/usr/local/libexec/coreutils/libstdbuf.*
335339
# Check that the manpage is not present
336-
! test -f /tmp/usr/local/share/man/man1/uu-whoami.1
340+
! test -f /tmp/usr/local/share/man/man1/whoami.1
337341
# Check that the completion is not present
338-
! test -f /tmp/usr/local/share/zsh/site-functions/_uu-install
339-
! test -f /tmp/usr/local/share/bash-completion/completions/uu-head.bash
340-
! test -f /tmp/usr/local/share/fish/vendor_completions.d/uu-cat.fish
342+
! test -f /tmp/usr/local/share/zsh/site-functions/_install
343+
! test -f /tmp/usr/local/share/bash-completion/completions/head.bash
344+
! test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
345+
# We publish them instead of discarding
346+
ZSTD_CLEVEL=19 tar --zstd -caf individual-aarch64-unknown-linux-gnu.tar.zst -C /tmp/usr/local bin
341347
env:
342348
RUST_BACKTRACE: "1"
343-
- name: "`make install`"
349+
- name: Publish
350+
uses: softprops/action-gh-release@v2
351+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
352+
with:
353+
tag_name: latest-commit
354+
draft: false
355+
prerelease: true
356+
files: |
357+
individual-aarch64-unknown-linux-gnu.tar.zst
358+
env:
359+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
360+
- name: "`make PROFILE=release-small PROG_PREFIX=u_ install`"
344361
shell: bash
345362
run: |
346363
set -x
347-
DESTDIR=/tmp/ make PROFILE=release install
348-
# Check that the utils are present
349-
test -f /tmp/usr/local/bin/tty
364+
DESTDIR=/tmp/ make PROFILE=release-small PROG_PREFIX=u_ install
365+
# Check that the utils are prefixed
366+
test -f /tmp/usr/local/bin/u_tty
350367
# Check that the manpage is present
351-
test -f /tmp/usr/local/share/man/man1/md5sum.1
368+
test -f /tmp/usr/local/share/man/man1/u_md5sum.1
352369
# Check that the completion is present
353-
test -f /tmp/usr/local/share/zsh/site-functions/_b2sum
354-
test -f /tmp/usr/local/share/bash-completion/completions/head.bash
355-
test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
370+
test -f /tmp/usr/local/share/zsh/site-functions/_u_b2sum
371+
test -f /tmp/usr/local/share/bash-completion/completions/u_head.bash
372+
test -f /tmp/usr/local/share/fish/vendor_completions.d/u_cat.fish
356373
env:
357374
RUST_BACKTRACE: "1"
358375
- name: "`make uninstall`"
@@ -361,18 +378,19 @@ jobs:
361378
set -x
362379
DESTDIR=/tmp/ make uninstall
363380
# Check that the utils are not present
364-
! test -f /tmp/usr/local/bin/tty
381+
! test -f /tmp/usr/local/bin/u_tty
365382
# Check that the manpage is not present
366-
! test -f /tmp/usr/local/share/man/man1/whoami.1
383+
! test -f /tmp/usr/local/share/man/man1/u_whoami.1
367384
# Check that the completion is not present
368-
! test -f /tmp/usr/local/share/zsh/site-functions/_install
369-
! test -f /tmp/usr/local/share/bash-completion/completions/head.bash
370-
! test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
371-
- name: "`make install MULTICALL=n`"
385+
! test -f /tmp/usr/local/share/zsh/site-functions/_u_install
386+
! test -f /tmp/usr/local/share/bash-completion/completions/u_head.bash
387+
! test -f /tmp/usr/local/share/fish/vendor_completions.d/u_cat.fish
388+
- name: "`make install PROFILE=release-small MULTICALL=n`"
372389
shell: bash
373390
run: |
374391
set -x
375-
DESTDIR=/tmp/ make PROFILE=release MULTICALL=n install
392+
# cargo should not rebuild with same profile
393+
timeout 30 DESTDIR=/tmp/ make PROFILE=release-smaill MULTICALL=n install
376394
# Check that *sum are present
377395
for s in {md5,b2,sha1,sha224,sha256,sha384,sha512}sum
378396
do test -e /tmp/usr/local/bin/${s}
@@ -381,7 +399,9 @@ jobs:
381399
shell: bash
382400
run: |
383401
set -x
384-
DESTDIR=/tmp/ make PROFILE=release MULTICALL=y LN="ln -svf" install
402+
DESTDIR=/tmp/ make MULTICALL=y LN="ln -svf" install
403+
# release should be default profile
404+
test -e target/release/coreutils
385405
# Check that symlinks of *sum are present
386406
for s in {md5,b2,sha1,sha224,sha256,sha384,sha512}sum
387407
do test $(readlink /tmp/usr/local/bin/${s}) = coreutils

0 commit comments

Comments
 (0)