From ad207bdb7024ed37b63acce7409f7a5a5e359725 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 10 May 2022 19:30:26 +0200 Subject: [PATCH] feat(ci): split Arch releases into vieter & vieter-git --- .woodpecker/.arch-rel.yml | 39 +++++++++++++++++++++++++++++++++++++++ .woodpecker/.arch.yml | 2 +- CHANGELOG.md | 5 ++++- PKGBUILD | 17 ++++++----------- PKGBUILD.dev | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 .woodpecker/.arch-rel.yml create mode 100644 PKGBUILD.dev diff --git a/.woodpecker/.arch-rel.yml b/.woodpecker/.arch-rel.yml new file mode 100644 index 00000000..b8f4c7ae --- /dev/null +++ b/.woodpecker/.arch-rel.yml @@ -0,0 +1,39 @@ +matrix: + PLATFORM: + - linux/amd64 + - linux/arm64 + +platform: ${PLATFORM} +branches: [main] +skip_clone: true + +pipeline: + build: + image: 'menci/archlinuxarm:base-devel' + commands: + # Add the vieter repository so we can use the compiler + - echo -e '[vieter]\nServer = https://arch.r8r.be/$repo/$arch\nSigLevel = Optional' >> /etc/pacman.conf + # Update packages + - pacman -Syu --noconfirm + # Create non-root user to perform build & switch to their home + - groupadd -g 1000 builder + - useradd -mg builder builder + - chown -R builder:builder "$PWD" + - "echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" + - su builder + # Due to a bug with the V compiler, we can't just use the PKGBUILD from + # inside the repo + - curl -OL "https://git.rustybever.be/vieter/vieter/raw/tag/$CI_COMMIT_TAG/PKGBUILD" + - makepkg -s --noconfirm --needed + when: + event: tag + + publish: + image: 'curlimages/curl' + commands: + # Publish the package + - 'for pkg in $(ls -1 *.pkg*); do curl -XPOST -T "$pkg" -H "X-API-KEY: $VIETER_API_KEY" https://arch.r8r.be/vieter/publish; done' + secrets: + - vieter_api_key + when: + event: tag diff --git a/.woodpecker/.arch.yml b/.woodpecker/.arch.yml index 6b8f8f2f..b2a59ba5 100644 --- a/.woodpecker/.arch.yml +++ b/.woodpecker/.arch.yml @@ -23,7 +23,7 @@ pipeline: - su builder # Due to a bug with the V compiler, we can't just use the PKGBUILD from # inside the repo - - curl -OL https://git.rustybever.be/vieter/vieter/raw/branch/dev/PKGBUILD + - curl -o PKGBUILD -L https://git.rustybever.be/vieter/vieter/raw/branch/dev/PKGBUILD.dev - makepkg -s --noconfirm --needed when: event: push diff --git a/CHANGELOG.md b/CHANGELOG.md index da09449b..2e17cd60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- `vieter build` command now only builds a single repository & uploads the +* `vieter build` command now only builds a single repository & uploads the build logs +* Official Arch packages are now split between `vieter` & `vieter-git` + * `vieter` is the latest release + * `vieter-git` is the latest commit on the dev branch ## [0.3.0-alpha.1](https://git.rustybever.be/vieter/vieter/src/tag/0.3.0-alpha.1) diff --git a/PKGBUILD b/PKGBUILD index 87c575ff..83ab8961 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,23 +1,18 @@ +# vim: ft=bash # Maintainer: Jef Roosens pkgbase='vieter' pkgname='vieter' -pkgver=0.2.0.r25.g20112b8 +pkgver='0.3.0_alpha.1' pkgrel=1 -depends=('glibc' 'openssl' 'libarchive' 'gc' 'sqlite') -makedepends=('git' 'gcc' 'vieter-v') +depends=('glibc' 'openssl' 'libarchive' 'sqlite') +makedepends=('git' 'vieter-v') arch=('x86_64' 'aarch64') url='https://git.rustybever.be/vieter/vieter' license=('AGPL3') -source=($pkgname::git+https://git.rustybever.be/vieter/vieter#branch=dev) +source=("$pkgname::git+https://git.rustybever.be/vieter/vieter#tag=${pkgver//_/-}") md5sums=('SKIP') -pkgver() { - cd "$pkgname" - - git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' -} - build() { cd "$pkgname" @@ -28,5 +23,5 @@ package() { pkgdesc="Vieter is a lightweight implementation of an Arch repository server." install -dm755 "$pkgdir/usr/bin" - install -Dm755 "$pkgbase/pvieter" "$pkgdir/usr/bin/vieter" + install -Dm755 "$pkgname/pvieter" "$pkgdir/usr/bin/vieter" } diff --git a/PKGBUILD.dev b/PKGBUILD.dev new file mode 100644 index 00000000..d0176d86 --- /dev/null +++ b/PKGBUILD.dev @@ -0,0 +1,35 @@ +# vim: ft=bash +# Maintainer: Jef Roosens + +pkgbase='vieter-git' +pkgname='vieter-git' +pkgver=0.2.0.r25.g20112b8 +pkgrel=1 +depends=('glibc' 'openssl' 'libarchive' 'sqlite') +makedepends=('git' 'vieter-v') +arch=('x86_64' 'aarch64') +url='https://git.rustybever.be/vieter/vieter' +license=('AGPL3') +source=("$pkgname::git+https://git.rustybever.be/vieter/vieter#branch=dev") +md5sums=('SKIP') +provides=('vieter') +conflicts=('vieter') + +pkgver() { + cd "$pkgname" + + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + cd "$pkgname" + + make prod +} + +package() { + pkgdesc="Vieter is a lightweight implementation of an Arch repository server." + + install -dm755 "$pkgdir/usr/bin" + install -Dm755 "$pkgname/pvieter" "$pkgdir/usr/bin/vieter" +}