@@ -52,151 +52,9 @@ jobs:
5252 name : dist
5353 path : dist/
5454
55- xbps :
56- runs-on : ubuntu-latest
57- needs : build
58- container :
59- image : ghcr.io/void-linux/void-glibc-full:latest
60- strategy :
61- fail-fast : true
62- matrix :
63- include :
64- - arch : x86_64
65- goreleaser_arch : amd64
66- - arch : i686
67- goreleaser_arch : 386
68- - arch : aarch64
69- goreleaser_arch : arm64
70- - arch : armv6l
71- goreleaser_arch : armv6
72- - arch : armv7l
73- goreleaser_arch : armv7
74- steps :
75- - name : Download dist artifacts
76- uses : actions/download-artifact@v4
77- with :
78- name : dist
79- path : dist/
80-
81- - name : Extract version
82- id : version
83- run : |
84- VERSION=$(cat dist/metadata.json | grep -o '"version":"[^"]*"' | cut -d'"' -f4)
85- echo "version=${VERSION}" >> $GITHUB_OUTPUT
86-
87- - name : Build XBPS package
88- run : |
89- xbps-install -Sy xbps
90-
91- BINARY="dist/d4s_linux_${{ matrix.goreleaser_arch }}*/d4s"
92- if [ "${{ matrix.goreleaser_arch }}" = "armv6" ]; then
93- BINARY="dist/d4s_linux_arm_6/d4s"
94- elif [ "${{ matrix.goreleaser_arch }}" = "armv7" ]; then
95- BINARY="dist/d4s_linux_arm_7/d4s"
96- fi
97-
98- PKG_DIR="pkg_${{ matrix.arch }}"
99- mkdir -p "${PKG_DIR}/usr/bin"
100- mkdir -p "${PKG_DIR}/usr/share/doc/d4s"
101-
102- cp ${BINARY} "${PKG_DIR}/usr/bin/d4s"
103- chmod 755 "${PKG_DIR}/usr/bin/d4s"
104- cp dist/d4s_linux_${{ matrix.goreleaser_arch }}*/LICENSE* "${PKG_DIR}/usr/share/doc/d4s/" 2>/dev/null || true
105- cp dist/d4s_linux_${{ matrix.goreleaser_arch }}*/README* "${PKG_DIR}/usr/share/doc/d4s/" 2>/dev/null || true
106-
107- cd "${PKG_DIR}"
108- xbps-create -A ${{ matrix.arch }} \
109- -n "d4s-${{ steps.version.outputs.version }}_1" \
110- -s "Master Docker like a pro, right from your terminal" \
111- -l "Apache-2.0" \
112- -m "jr-k <jrk@jierka.com>" \
113- -H "https://d4scli.io" \
114- .
115- mv *.xbps ../
116-
117- - name : Upload XBPS artifact
118- uses : actions/upload-artifact@v4
119- with :
120- name : xbps-${{ matrix.arch }}
121- path : " *.xbps"
122-
123- gentoo :
124- runs-on : ubuntu-latest
125- needs : build
126- steps :
127- - name : Download dist artifacts
128- uses : actions/download-artifact@v4
129- with :
130- name : dist
131- path : dist/
132-
133- - name : Extract version
134- id : version
135- run : |
136- VERSION=$(cat dist/metadata.json | grep -o '"version":"[^"]*"' | cut -d'"' -f4)
137- echo "version=${VERSION}" >> $GITHUB_OUTPUT
138-
139- - name : Generate ebuild
140- run : |
141- VERSION="${{ steps.version.outputs.version }}"
142- EBUILD_DIR="gentoo-overlay/app-misc/d4s"
143- mkdir -p "${EBUILD_DIR}"
144-
145- cat > "${EBUILD_DIR}/d4s-${VERSION}.ebuild" << 'EBUILD_EOF'
146- # Copyright 2024 Gentoo Authors
147- # Distributed under the terms of the Apache-2.0 license
148-
149- EAPI=8
150-
151- DESCRIPTION="Master Docker like a pro, right from your terminal"
152- HOMEPAGE="https://d4scli.io https://github.com/jr-k/d4s"
153-
154- BASE_URI="https://github.com/jr-k/d4s/releases/download/v${PV}"
155- SRC_URI="
156- amd64? ( ${BASE_URI}/d4s_${PV}_linux_amd64.tar.gz )
157- arm64? ( ${BASE_URI}/d4s_${PV}_linux_arm64.tar.gz )
158- arm? ( ${BASE_URI}/d4s_${PV}_linux_armv7.tar.gz )
159- x86? ( ${BASE_URI}/d4s_${PV}_linux_x86.tar.gz )
160- "
161-
162- LICENSE="Apache-2.0"
163- SLOT="0"
164- KEYWORDS="~amd64 ~arm ~arm64 ~x86"
165-
166- RDEPEND=""
167- DEPEND=""
168-
169- S="${WORKDIR}"
170-
171- QA_PREBUILT="usr/bin/d4s"
172-
173- src_install() {
174- dobin d4s
175- dodoc README.md LICENSE
176- }
177- EBUILD_EOF
178-
179- sed -i 's/^ //' "${EBUILD_DIR}/d4s-${VERSION}.ebuild"
180-
181- mkdir -p gentoo-overlay/metadata
182- cat > gentoo-overlay/metadata/layout.conf << 'EOF'
183- masters = gentoo
184- auto-sync = false
185- EOF
186- sed -i 's/^ //' gentoo-overlay/metadata/layout.conf
187-
188- mkdir -p gentoo-overlay/profiles
189- echo "gentoo-d4s" > gentoo-overlay/profiles/repo_name
190-
191- - name : Upload gentoo overlay artifact
192- uses : actions/upload-artifact@v4
193- with :
194- name : gentoo-overlay
195- path : gentoo-overlay/
196-
19755 release :
19856 runs-on : ubuntu-latest
199- needs : [build, xbps, gentoo ]
57+ needs : [build]
20058 steps :
20159 - name : Checkout
20260 uses : actions/checkout@v4
@@ -219,19 +77,6 @@ jobs:
21977 with :
22078 go-version : stable
22179
222- - name : Download all XBPS artifacts
223- uses : actions/download-artifact@v4
224- with :
225- pattern : xbps-*
226- path : ${{ runner.temp }}/xbps-packages/
227- merge-multiple : true
228-
229- - name : Download gentoo overlay
230- uses : actions/download-artifact@v4
231- with :
232- name : gentoo-overlay
233- path : ${{ runner.temp }}/gentoo-overlay/
234-
23580 - name : Extract version
23681 id : version
23782 run : |
@@ -247,31 +92,6 @@ jobs:
24792 env :
24893 GITHUB_TOKEN : ${{ secrets.GORELEASER_GITHUB_TOKEN }}
24994
250- - name : Upload XBPS packages to release
251- env :
252- GH_TOKEN : ${{ secrets.GORELEASER_GITHUB_TOKEN }}
253- run : |
254- # Add XBPS checksums to checksums.txt
255- cd ${{ runner.temp }}/xbps-packages/
256- sha256sum *.xbps >> ${{ github.workspace }}/dist/checksums.txt
257- cd ${{ github.workspace }}
258-
259- # Upload XBPS packages
260- gh release upload "${{ github.ref_name }}" ${{ runner.temp }}/xbps-packages/*.xbps --repo "${{ github.repository }}"
261-
262- - name : Upload Gentoo ebuild to release
263- env :
264- GH_TOKEN : ${{ secrets.GORELEASER_GITHUB_TOKEN }}
265- run : |
266- VERSION="${{ steps.version.outputs.version }}"
267- EBUILD_FILE="${{ runner.temp }}/gentoo-overlay/app-misc/d4s/d4s-${VERSION}.ebuild"
268-
269- # Add ebuild checksum
270- sha256sum "${EBUILD_FILE}" | sed "s|${{ runner.temp }}/gentoo-overlay/app-misc/d4s/||" >> dist/checksums.txt
271-
272- # Upload ebuild
273- gh release upload "${{ github.ref_name }}" "${EBUILD_FILE}" --repo "${{ github.repository }}"
274-
27595 - name : Update checksums.txt with all artifacts
27696 env :
27797 GH_TOKEN : ${{ secrets.GORELEASER_GITHUB_TOKEN }}
@@ -286,43 +106,3 @@ jobs:
286106 if : startsWith(github.ref, 'refs/tags/v')
287107 with :
288108 subject-checksums : ./dist/digests.txt
289-
290- - name : Generate Gentoo Manifest and push overlay
291- env :
292- GH_TOKEN : ${{ secrets.GORELEASER_GITHUB_TOKEN }}
293- run : |
294- VERSION="${{ steps.version.outputs.version }}"
295- OVERLAY_DIR="${{ runner.temp }}/overlay"
296-
297- if ! gh repo view jr-k/gentoo-d4s &>/dev/null; then
298- gh repo create jr-k/gentoo-d4s --public --description "Gentoo overlay for d4s"
299- sleep 2
300- fi
301-
302- git clone "https://x-access-token:${GH_TOKEN}@github.com/jr-k/gentoo-d4s.git" "${OVERLAY_DIR}" || {
303- mkdir -p "${OVERLAY_DIR}"
304- cd "${OVERLAY_DIR}"
305- git init
306- git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/jr-k/gentoo-d4s.git"
307- cd -
308- }
309-
310- cp -r ${{ runner.temp }}/gentoo-overlay/* "${OVERLAY_DIR}/"
311-
312- cd "${OVERLAY_DIR}/app-misc/d4s"
313- for arch in amd64 arm64 armv7 x86; do
314- TARBALL="d4s_${VERSION}_linux_${arch}.tar.gz"
315- URL="https://github.com/jr-k/d4s/releases/download/v${VERSION}/${TARBALL}"
316- curl -sL -o "/tmp/${TARBALL}" "${URL}"
317- SIZE=$(stat -c%s "/tmp/${TARBALL}")
318- SHA512=$(sha512sum "/tmp/${TARBALL}" | cut -d' ' -f1)
319- BLAKE2B=$(b2sum "/tmp/${TARBALL}" | cut -d' ' -f1)
320- echo "DIST ${TARBALL} ${SIZE} BLAKE2B ${BLAKE2B} SHA512 ${SHA512}" >> Manifest
321- done
322- cd "${OVERLAY_DIR}"
323-
324- git config user.name "GoReleaser Bot"
325- git config user.email "bot@goreleaser.com"
326- git add -A
327- git commit -m "Update d4s to ${VERSION}" || exit 0
328- git push
0 commit comments