File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ permissions:
1919
2020jobs :
2121 build-and-push-image :
22+ strategy :
23+ matrix :
24+ variety :
25+ - archlinux
26+ - busybox
27+ - debian
28+ - ubuntu
2229 name : docker buildx pkgxdev/pkgx:${{ github.event.release.tag_name || github.event.inputs.tag }}
2330 runs-on : ubuntu-latest
2431 steps :
3138 - name : is_latest?
3239 id : latest
3340 run : |
41+ if [ ${{ matrix.variety }} != ubuntu ]; then
42+ echo "value=false" >> "${GITHUB_OUTPUT}"
43+ return
44+ fi
3445 TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.tag }}"
3546 LATEST_RELEASE=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name')
3647 if [ "$TAG_NAME" == "$LATEST_RELEASE" ]; then
91102 --push \
92103 $tags \
93104 --platform linux/amd64,linux/arm64 \
94- --file ./src/.github/Dockerfile \
105+ --file ./src/.github/Dockerfile.${{ matrix.variety }} \
95106 .
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: ci·docker
33on :
44 pull_request :
55 paths :
6- - .github /Dockerfile
6+ - docker /Dockerfile.*
77 - .github/workflows/ci.docker.yml
88
99concurrency :
@@ -15,49 +15,42 @@ permissions:
1515 packages : write
1616
1717jobs :
18- docker-build :
18+ go :
1919 runs-on : ubuntu-latest
20- container : debian:buster-slim
20+ strategy :
21+ matrix :
22+ variety :
23+ - archlinux
24+ - busybox
25+ - debian
26+ - ubuntu
2127 steps :
2228 - uses : actions/checkout@v4
2329
24- - run : apt-get update && apt-get install -y curl gcc perl make
25-
26- - uses : dtolnay/rust-toolchain@stable
27- - run : cargo build --release
28-
29- - uses : actions/upload-artifact@v4
30- with :
31- name : products
32- path : ./target/release/pkgx
33-
34- docker-test :
35- runs-on : ubuntu-latest
36- needs : docker-build
37- steps :
38- - uses : actions/checkout@v4
39-
40- - uses : actions/download-artifact@v4
30+ - uses : robinraju/release-downloader@v1.12
4131 with :
42- name : products
32+ fileName : pkgx-*+linux+x86-64.tar.gz
33+ latest : true
4334
4435 - run : |
4536 mkdir products
46- mv ./pkgx products/$(uname -m)
37+ tar xzf pkgx*.tar.gz
38+ mv pkgx products/$(uname -m)
4739 curl https://pkgxdev.github.io/pkgm/pkgm.ts -o products/pkgm
4840
4941 - run :
5042 docker build
51- --tag pkgxdev/pkgx
52- --file .github /Dockerfile
43+ --tag pkgxdev/${{ matrix.variety }}
44+ --file docker /Dockerfile.${{ matrix.variety }}
5345 .
5446
5547 - run : |
5648 cat <<EoD> Dockerfile
57- FROM pkgxdev/pkgx
49+ FROM pkgxdev/${{ matrix.variety }}
5850 RUN pkgx --version
5951 RUN if git --version; then exit 1; fi
6052 RUN pkgx git --version
53+ RUN pkgm --version
6154 RUN pkgm install git
6255 RUN if ! git --version; then exit 2; fi
6356 EoD
Original file line number Diff line number Diff line change 1+ FROM archlinux AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM archlinux AS stage1
7+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgm /usr/local/bin/
8+
9+ CMD ["/bin/bash"]
10+ ENTRYPOINT ["/usr/local/bin/pkgx"]
Original file line number Diff line number Diff line change 1+ FROM debian:buster-slim AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ # FIXME a newer glibc would be nice, but the libpthread.so we copy in then fails
7+ FROM busybox:1.31-glibc AS stage1
8+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgm /usr/local/bin/
9+
10+ # pkgx packages also need libgcc
11+ COPY --from=stage0 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1
12+ # these are part of glibc but for some reason this image doesn’t have them
13+ COPY --from=stage0 /lib/x86_64-linux-gnu/librt-2.28.so /lib/librt.so.1
14+ COPY --from=stage0 /lib/x86_64-linux-gnu/libdl-2.28.so /lib/libdl.so.2
15+ # we need env for `pkgm`
16+ COPY --from=stage0 /usr/bin/env /usr/bin/env
17+
18+ CMD ["/bin/bash"]
19+ ENTRYPOINT ["/usr/local/bin/pkgx"]
Original file line number Diff line number Diff line change 1+ FROM debian:stable-slim AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM debian:stable-slim AS stage1
7+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgm /usr/local/bin/
8+
9+ CMD ["/bin/bash"]
10+ ENTRYPOINT ["/usr/local/bin/pkgx"]
Original file line number Diff line number Diff line change 1+ FROM ubuntu AS stage0
2+ COPY ./products/* /pkgx/
3+ RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
4+ RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
5+
6+ FROM ubuntu AS stage1
7+ COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgm /usr/local/bin/
8+
9+ CMD ["/bin/bash"]
10+ ENTRYPOINT ["/usr/local/bin/pkgx"]
You can’t perform that action at this time.
0 commit comments