feat: add alpine ci
All checks were successful
/ build (push) Successful in 27m51s

This commit is contained in:
magmaus3 2025-05-05 16:33:46 +02:00
parent a08868a2e5
commit 52cb7bd08b
Signed by: magmaus3
GPG key ID: C8AABFABFA2FAF66
2 changed files with 72 additions and 6 deletions

View file

@ -1,6 +1,15 @@
on:
- workflow-dispatch
- push
workflow-dispatch:
push:
paths-ignore:
- "*.md"
- "**/*.md"
- ".gitlab-ci.yml"
- ".gitignore"
- "renovate.json"
- "debian/**"
- "docker/**"
- "docs/**"
jobs:
build:
@ -13,7 +22,15 @@ jobs:
run: |
apk update
apk upgrade
apk add nodejs git alpine-sdk
apk add nodejs git alpine-sdk curl
- name: cache alpine repo
uses: actions/cache@v3
with:
path: |
/var/cache/apk
key: alpine-cache
- uses: actions/checkout@v4
name: checkout the alpine dir
with:
@ -35,6 +52,7 @@ jobs:
echo $HOME
echo 'PACKAGER_PRIVKEY="/root/.abuild/ci@continuwuity.rsa"' > ~/.abuild/abuild.conf
ls ~/.abuild
cp /root/.abuild/*.rsa.pub /etc/apk/keys
- name: go go gadget abuild
run: |
@ -42,8 +60,49 @@ jobs:
# modify the APKBUILD to use the current branch instead of the release
# note that it seems to require the repo to be public (as you'll get
# a 404 even if the token is provided)
# export ARCHIVE_URL="https:${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz"
export ARCHIVE_URL="${{ github.server_url }}/${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz"
echo $ARCHIVE_URL
export COMMIT_DATE=$(date -d @$(git show --no-patch --format=%ct HEAD) +%Y%m%d%H%M)
echo $ARCHIVE_URL $COMMIT_DATE
# modify the APKBUILD to use the git archive tarball and version
#
sed -i '/^source=/c\source="'"$ARCHIVE_URL" APKBUILD
sed -i "/^pkgver=/s/$/_git${COMMIT_DATE}/" APKBUILD
env
abuild -F checksum
abuild -Fr
abuild -FrK
# - name: Cache Rust registry
# uses: actions/cache@v3
# with:
# path: |
# .cargo/git
# .cargo/git/checkouts
# .cargo/registry
# .cargo/registry/src
# key: rust-registry-image-${{hashFiles('**/Cargo.lock') }}
# - name: Cache cargo target
# id: cache-cargo-target
# uses: actions/cache@v3
# with:
# path: |
# cargo-target-${{ matrix.slug }}
# key: cargo-target-${{ matrix.slug }}-${{hashFiles('**/Cargo.lock') }}-${{steps.rust-toolchain.outputs.rustc_version}}
- name: upload to registry
run: |
for pkg in $(find /root/packages -name '*.apk'); do
echo uploading $pkg
curl --header 'Authorization: token ${{ secrets.FORGEJO_TOKEN }}' \
--upload-file $pkg \
${{ env.GITHUB_SERVER_URL }}/api/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/alpine/edge/git
done
- name: 'debug state on failure (note: only for local testing)'
if: always()
run: |
env | tee /tmp/env
sleep 1d || true

View file

@ -23,9 +23,16 @@ source="https://forgejo.ellis.link/continuwuation/continuwuity/archive/v0.5.0-rc
continuwuity.initd
continuwuity.confd
"
_giturl="https://forgejo.ellis.link/continuwuation/continuwuity"
_gitbranch="main"
builddir="$srcdir/continuwuity"
options="net !check"
#snapshot() {
# # used for building from git
# git clone --depth=1 $_giturl -b $_gitbranch
#}
prepare() {
default_prepare
cd $srcdir/continuwuity