This commit is contained in:
parent
a08868a2e5
commit
ab2c7c8b5c
2 changed files with 70 additions and 8 deletions
|
@ -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,45 @@ 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="${{ github.server_url }}/${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz"
|
||||
echo $ARCHIVE_URL
|
||||
sed -i '/^source=/c\source="'"$ARCHIVE_URL" APKBUILD
|
||||
abuild -F checksum
|
||||
abuild -Fr
|
||||
# export ARCHIVE_URL="https:${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz"
|
||||
export ARCHIVE_URL="https:${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz"
|
||||
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 -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: |
|
||||
curl --header 'Authorization: token ${{ secrets.FORGEJO_TOKEN }}' \
|
||||
--upload-file /root/packages/**/**/*.apk \
|
||||
${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/alpine/edge/git
|
||||
# - name: 'debug state on failure (note: only for local testing)'
|
||||
# if: always()
|
||||
# run: |
|
||||
# env | tee /tmp/env
|
||||
# sleep 1d || true
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue