8181 os : ubuntu-latest
8282 artifact_name : tmpltool
8383 asset_name : tmpltool-linux-x86_64-musl
84+ apk_arch : x86_64
85+
86+ - target : aarch64-unknown-linux-musl
87+ os : ubuntu-latest
88+ artifact_name : tmpltool
89+ asset_name : tmpltool-linux-aarch64-musl
90+ apk_arch : aarch64
8491
8592 - target : aarch64-unknown-linux-gnu
8693 os : ubuntu-latest
@@ -116,10 +123,10 @@ jobs:
116123 targets : ${{ matrix.target }}
117124
118125 - name : Install cross (Linux ARM)
119- if : matrix.target == 'aarch64-unknown-linux-gnu'
126+ if : matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'aarch64-unknown-linux-musl'
120127 run : cargo install cross --git https://github.com/cross-rs/cross
121128
122- - name : Install musl tools (Linux musl)
129+ - name : Install musl tools (Linux musl x86_64 )
123130 if : matrix.target == 'x86_64-unknown-linux-musl'
124131 run : |
125132 sudo apt-get update
@@ -144,11 +151,11 @@ jobs:
144151 key : ${{ runner.os }}-${{ matrix.target }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
145152
146153 - name : Build (cross)
147- if : matrix.target == 'aarch64-unknown-linux-gnu'
154+ if : matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'aarch64-unknown-linux-musl'
148155 run : cross build --release --target ${{ matrix.target }}
149156
150157 - name : Build (cargo)
151- if : matrix.target != 'aarch64-unknown-linux-gnu'
158+ if : matrix.target != 'aarch64-unknown-linux-gnu' && matrix.target != 'aarch64-unknown-linux-musl'
152159 run : cargo build --release --target ${{ matrix.target }}
153160
154161 - name : Strip binary (Linux/macOS)
@@ -216,6 +223,46 @@ jobs:
216223 name : tmpltool-rpm-${{ matrix.rpm_arch }}
217224 path : tmpltool-${{ needs.semantic-release.outputs.new_release_version }}-1.${{ matrix.rpm_arch }}.rpm
218225
226+ - name : Build APK package
227+ if : matrix.apk_arch != ''
228+ run : |
229+ VERSION=${{ needs.semantic-release.outputs.new_release_version }}
230+ ARCH=${{ matrix.apk_arch }}
231+ PKGNAME="tmpltool-${VERSION}-r0-${ARCH}.apk"
232+
233+ # Create package directory structure
234+ mkdir -p apk_pkg/usr/bin
235+ cp target/${{ matrix.target }}/release/tmpltool apk_pkg/usr/bin/
236+ chmod 755 apk_pkg/usr/bin/tmpltool
237+
238+ # Create .PKGINFO
239+ cat > apk_pkg/.PKGINFO << EOF
240+ pkgname = tmpltool
241+ pkgver = ${VERSION}-r0
242+ pkgdesc = A fast and simple command-line template rendering tool using MiniJinja templates
243+ url = https://github.com/bordeux/tmpltool
244+ arch = ${ARCH}
245+ license = MIT
246+ size = $(stat -c%s target/${{ matrix.target }}/release/tmpltool 2>/dev/null || stat -f%z target/${{ matrix.target }}/release/tmpltool)
247+ origin = tmpltool
248+ maintainer = Chris Bednarczyk <tmpltool@bordeux.net>
249+ builddate = $(date +%s)
250+ EOF
251+
252+ # Create the APK (gzipped tarball)
253+ cd apk_pkg
254+ tar -czf "../${PKGNAME}" .PKGINFO usr
255+ cd ..
256+
257+ echo "Created ${PKGNAME}"
258+
259+ - name : Upload APK artifact
260+ if : matrix.apk_arch != ''
261+ uses : actions/upload-artifact@v4
262+ with :
263+ name : tmpltool-apk-${{ matrix.apk_arch }}
264+ path : tmpltool-${{ needs.semantic-release.outputs.new_release_version }}-r0-${{ matrix.apk_arch }}.apk
265+
219266 - name : Upload artifact (Windows)
220267 if : matrix.os == 'windows-latest'
221268 uses : actions/upload-artifact@v4
@@ -286,28 +333,45 @@ jobs:
286333 cache-from : type=gha
287334 cache-to : type=gha,mode=max
288335
289- update-homebrew :
290- name : Trigger Homebrew Formula Update
291- needs : [semantic-release, upload-release-assets]
292- runs-on : ubuntu-latest
293- steps :
294- - name : Trigger homebrew-tap workflow
295- run : |
296- curl -X POST \
297- -H "Authorization: token ${{ secrets.HOMEBREW_TAP_TOKEN }}" \
298- -H "Accept: application/vnd.github.v3+json" \
299- https://api.github.com/repos/bordeux/homebrew-tap/actions/workflows/update-formulas.yml/dispatches \
300- -d '{"ref":"master","inputs":{"project":"tmpltool"}}'
301-
302- update-apt-repo :
303- name : Trigger APT Repository Update
336+ update-package-repos :
337+ name : Trigger ${{ matrix.name }} Update
304338 needs : [semantic-release, upload-release-assets]
305339 runs-on : ubuntu-latest
340+ strategy :
341+ matrix :
342+ include :
343+ - name : Homebrew
344+ repo : bordeux/homebrew-tap
345+ workflow : update-formulas.yml
346+ token_env : HOMEBREW_TAP_TOKEN
347+ - name : APT Repository
348+ repo : bordeux/apt-repo
349+ workflow : update-repo.yml
350+ token_env : APT_REPO_TOKEN
351+ - name : APK Repository
352+ repo : bordeux/apk-repo
353+ workflow : update-repo.yml
354+ token_env : APK_REPO_TOKEN
355+ - name : RPM Repository
356+ repo : bordeux/rpm-repo
357+ workflow : update-repo.yml
358+ token_env : RPM_REPO_TOKEN
359+ - name : ARCH Repository
360+ repo : bordeux/arch-repo
361+ workflow : update-repo.yml
362+ token_env : ARCH_REPO_TOKEN
306363 steps :
307- - name : Trigger apt-repo workflow
364+ - name : Trigger ${{ matrix.name }} workflow
365+ env :
366+ HOMEBREW_TAP_TOKEN : ${{ secrets.HOMEBREW_TAP_TOKEN }}
367+ APT_REPO_TOKEN : ${{ secrets.APT_REPO_TOKEN }}
368+ APK_REPO_TOKEN : ${{ secrets.APK_REPO_TOKEN }}
369+ RPM_REPO_TOKEN : ${{ secrets.RPM_REPO_TOKEN }}
370+ ARCH_REPO_TOKEN : ${{ secrets.ARCH_REPO_TOKEN }}
308371 run : |
372+ TOKEN="${!${{ matrix.token_env }}}"
309373 curl -X POST \
310- -H "Authorization: token ${{ secrets.APT_REPO_TOKEN }} " \
374+ -H "Authorization: token $TOKEN " \
311375 -H "Accept: application/vnd.github.v3+json" \
312- https://api.github.com/repos/bordeux/apt- repo/actions/workflows/update-repo.yml /dispatches \
376+ " https://api.github.com/repos/${{ matrix. repo }} /actions/workflows/${{ matrix.workflow }} /dispatches" \
313377 -d '{"ref":"master","inputs":{"project":"bordeux/tmpltool"}}'
0 commit comments