5858 - uses : actions/attest-build-provenance@v3
5959 if : startsWith(github.ref, 'refs/tags/v') # snapshots won't push docker images
6060 with :
61- subject-checksums : ./dist/digests.txt
61+ subject-checksums : ./dist/digests.txt
62+
63+ - name : Upload dist artifacts
64+ uses : actions/upload-artifact@v4
65+ with :
66+ name : dist
67+ path : dist/
68+
69+ xbps :
70+ runs-on : ubuntu-latest
71+ needs : goreleaser
72+ container :
73+ image : ghcr.io/void-linux/void-glibc-full:latest
74+ strategy :
75+ matrix :
76+ include :
77+ - arch : x86_64
78+ goreleaser_arch : amd64
79+ - arch : i686
80+ goreleaser_arch : 386
81+ - arch : aarch64
82+ goreleaser_arch : arm64
83+ - arch : armv6l
84+ goreleaser_arch : armv6
85+ - arch : armv7l
86+ goreleaser_arch : armv7
87+ steps :
88+ - name : Download dist artifacts
89+ uses : actions/download-artifact@v4
90+ with :
91+ name : dist
92+ path : dist/
93+
94+ - name : Extract version
95+ id : version
96+ run : |
97+ VERSION=$(cat dist/metadata.json | grep -o '"version":"[^"]*"' | cut -d'"' -f4)
98+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
99+
100+ - name : Build XBPS package
101+ run : |
102+ xbps-install -Sy xbps
103+
104+ BINARY="dist/d4s_linux_${{ matrix.goreleaser_arch }}*/d4s"
105+ if [ "${{ matrix.goreleaser_arch }}" = "armv6" ]; then
106+ BINARY="dist/d4s_linux_arm_6/d4s"
107+ elif [ "${{ matrix.goreleaser_arch }}" = "armv7" ]; then
108+ BINARY="dist/d4s_linux_arm_7/d4s"
109+ fi
110+
111+ # Create package structure
112+ PKG_DIR="pkg_${{ matrix.arch }}"
113+ mkdir -p "${PKG_DIR}/usr/bin"
114+ mkdir -p "${PKG_DIR}/usr/share/doc/d4s"
115+
116+ cp ${BINARY} "${PKG_DIR}/usr/bin/d4s"
117+ chmod 755 "${PKG_DIR}/usr/bin/d4s"
118+ cp dist/d4s_linux_${{ matrix.goreleaser_arch }}*/LICENSE* "${PKG_DIR}/usr/share/doc/d4s/" 2>/dev/null || cp LICENSE "${PKG_DIR}/usr/share/doc/d4s/" 2>/dev/null || true
119+ cp dist/d4s_linux_${{ matrix.goreleaser_arch }}*/README* "${PKG_DIR}/usr/share/doc/d4s/" 2>/dev/null || cp README.md "${PKG_DIR}/usr/share/doc/d4s/" 2>/dev/null || true
120+
121+ # Create XBPS package
122+ cd "${PKG_DIR}"
123+ xbps-create -A ${{ matrix.arch }} \
124+ -n "d4s-${{ steps.version.outputs.version }}_1" \
125+ -s "Master Docker like a pro, right from your terminal" \
126+ -l "Apache-2.0" \
127+ -m "jr-k <jrk@jierka.com>" \
128+ -H "https://d4scli.io" \
129+ .
130+ mv *.xbps ../
131+
132+ - name : Upload XBPS to release
133+ env :
134+ GH_TOKEN : ${{ secrets.GORELEASER_GITHUB_TOKEN }}
135+ run : |
136+ xbps-install -Sy github-cli
137+ gh release upload "${{ github.ref_name }}" *.xbps --repo "${{ github.repository }}"
0 commit comments