Skip to content

Commit

Permalink
ci: add arch linux packaging job
Browse files Browse the repository at this point in the history
  • Loading branch information
cilki committed Jun 1, 2024
1 parent 2582a90 commit 59bd0d5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
linux:
name: linux / ${{ matrix.target }}
runs-on: ubuntu-latest
# needs: github
needs: github
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
id: get_tags
run: |
for tag in $(git tag --points-at HEAD); do
echo "${tag%-*}=${tag##*-}" >> "$GITHUB_OUTPUT"
echo "${tag%-*}=${tag##*-}" >>"$GITHUB_OUTPUT"
done
- uses: docker/build-push-action@v5
Expand All @@ -231,3 +231,48 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: fossable/goldboot

archlinux:
name: archlinux / ${{ matrix.package }}
runs-on: ubuntu-latest
needs: github
strategy:
matrix:
package:
- goldboot
- goldboot-registry
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-tags: true

- name: Find version tags
id: get_tags
run: |
for tag in $(git tag --points-at HEAD); do
if [ "${tag%-*}" = "${{ matrix.package }}" ]; then
echo "pkgver=${tag##*-}" >>"$GITHUB_OUTPUT"
fi
done
- uses: heyhusen/archlinux-package-action@v2
with:
path: dist/pacman/${{ matrix.package }}
srcinfo: true
pkgver: ${{ steps.get_tags.outputs.pkgver }}

- name: Push release to AUR
env:
AUR_PRIVATE_KEY: ${{ secrets.AUR_PRIVATE_KEY }}
run: |
echo "${AUR_PRIVATE_KEY}" >/tmp/id_rsa
chmod 600 /tmp/id_rsa
cd dist/pacman/${{ matrix.package }}
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
ssh-keyscan -H aur.archlinux.org >/tmp/known_hosts
git add .SRCINFO PKGBUILD
git commit -m "release: ${{ steps.get_tags.outputs.pkgver }}"
GIT_SSH_COMMAND='ssh -i /tmp/id_rsa -o UserKnownHostsFile=/tmp/known_hosts' git push -u origin master
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "dist/pacman/goldboot"]
path = dist/pacman/goldboot
url = ssh://[email protected]/goldboot
[submodule "dist/pacman/goldboot-registry"]
path = dist/pacman/goldboot-registry
url = ssh://[email protected]/goldboot-registry
1 change: 1 addition & 0 deletions dist/pacman/goldboot
Submodule goldboot added at 091712
1 change: 1 addition & 0 deletions dist/pacman/goldboot-registry
Submodule goldboot-registry added at 705a6b

0 comments on commit 59bd0d5

Please sign in to comment.