11name : Publish
22on :
33 pull_request :
4+ merge_group :
45 push :
56 branches :
67 - ' *'
@@ -13,19 +14,54 @@ jobs:
1314 runs-on : ubuntu-latest
1415 steps :
1516 - name : Checkout
16- uses : actions/checkout@v3
17- - uses : cachix/install-nix-action@v18
17+ uses : actions/checkout@v4
18+ - uses : cachix/install-nix-action@v31
1819 - name : Build tarballs
1920 run : |
20- nix- build -A hydraJobs.tarball
21+ nix build -L .# hydraJobs.tarball
2122 install -D ./result/tarballs/*.tar.bz2 ./dist/patchelf-$(cat version).tar.bz2
2223 install -D ./result/tarballs/*.tar.gz ./dist/patchelf-$(cat version).tar.gz
23- - uses : actions/upload-artifact@v3
24+ - uses : actions/upload-artifact@v4
2425 with :
25- name : patchelf
26+ name : patchelf-tarball
2627 path : dist/*
2728
28- build_binaries :
29+ build_windows :
30+ name : Build windows executable
31+ runs-on : ubuntu-latest
32+ steps :
33+ - name : Checkout
34+ uses : actions/checkout@v4
35+ - uses : cachix/install-nix-action@v31
36+ - name : Build windows executable
37+ run : |
38+ nix build -L .#patchelf-win32 .#patchelf-win64
39+ install -D ./result/bin/patchelf.exe ./dist/patchelf-win32-$(cat version).exe
40+ install -D ./result-1/bin/patchelf.exe ./dist/patchelf-win64-$(cat version).exe
41+ - uses : actions/upload-artifact@v4
42+ with :
43+ name : patchelf-windows
44+ path : dist/*
45+
46+ test_windows :
47+ name : Test windows binaries
48+ needs : [build_windows]
49+ runs-on : windows-latest
50+ steps :
51+ - uses : actions/checkout@v4
52+ - uses : actions/download-artifact@v5
53+ with :
54+ name : patchelf-windows
55+ path : dist
56+ - name : Show binaries
57+ run : dir .\\dist
58+ - name : Test windows 64-bit binary
59+ run : .\\dist\\patchelf-win32-*.exe --version
60+
61+ - name : Test windows 32-bit binary
62+ run : .\\dist\\patchelf-win64-*.exe --version
63+
64+ build_musl :
2965 name : Build static musl binaries
3066 needs : [build_tarballs]
3167 runs-on : ubuntu-latest
@@ -36,11 +72,21 @@ jobs:
3672 steps :
3773 - name : Set up QEMU
3874 if : matrix.platform != 'amd64'
39- uses : docker/setup-qemu-action@v2
75+ uses : docker/setup-qemu-action@v3
76+
77+ - name : Set docker arch
78+ run : |
79+ platform=${{ matrix.platform }}
80+ if [[ $platform == arm64v8 ]]; then
81+ platform=arm64
82+ elif [[ $platform == arm32v7 ]]; then
83+ platform=arm
84+ fi
85+ echo "DOCKER_PLATFORM=$platform" >> $GITHUB_ENV
4086
41- - uses : actions/download-artifact@v3
87+ - uses : actions/download-artifact@v5
4288 with :
43- name : patchelf
89+ name : patchelf-tarball
4490 path : dist
4591 - name : Build binaries
4692 env :
54100 rm -f dist/*
55101 cd patchelf-*
56102 ./configure --prefix /patchelf
57- make check
103+ make check || (cat tests/test-suite.log; exit 1)
58104 make install-strip
59105 cd -
60106 tar -czf ./dist/patchelf-\$(cat patchelf-*/version)-\$(uname -m).tar.gz -C /patchelf .
65111 else
66112 ENTRYPOINT=
67113 fi
68- docker run -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh"
114+ docker run --platform "$DOCKER_PLATFORM" - e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh"
69115 - name : Check binaries
70116 run : |
71117 cat <<EOF > check.sh
@@ -74,21 +120,22 @@ jobs:
74120 tar -xf ./dist/patchelf-*-*.tar.gz
75121 ./bin/patchelf --version
76122 EOF
77- docker run -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh"
78- - uses : actions/upload-artifact@v3
123+ docker run --platform "$DOCKER_PLATFORM" - v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh"
124+ - uses : actions/upload-artifact@v4
79125 with :
80- name : patchelf
126+ name : patchelf-${{ matrix.platform }}
81127 path : dist/*
82128
83129 publish :
84130 name : Publish tarballs & binaries
85- needs : [build_tarballs, build_binaries ]
131+ needs : [build_tarballs, build_windows, build_musl ]
86132 if : github.event_name == 'push' && github.repository == 'NixOS/patchelf' && startsWith(github.ref, 'refs/tags/')
87133 runs-on : ubuntu-latest
88134 steps :
89- - uses : actions/download-artifact@v3
135+ - uses : actions/download-artifact@v5
90136 with :
91- name : patchelf
137+ pattern : patchelf-*
138+ merge-multiple : true
92139 path : dist
93140 - name : Upload binaries to release
94141 uses : svenstaro/upload-release-action@v2
0 commit comments