diff --git a/.SRCINFO b/.SRCINFO index 725450f..996c971 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,14 +1,13 @@ pkgbase = create-vlang-app pkgdesc = V-native scaffolding CLI for the V programming language - pkgver = 0.0.1 + pkgver = 0.1.0 pkgrel = 1 url = https://github.com/Create-Vlang-App/create-vlang-app arch = x86_64 arch = aarch64 license = MIT depends = git - makedepends = vlang - source = create-vlang-app-0.0.1.tar.gz::https://github.com/Create-Vlang-App/create-vlang-app/archive/e5c07f5.tar.gz - sha256sums = 2db15ba3f4992eb5dcf1dffbd5a26826e433a77523fb102c6e47d7c3d965d1de + source = create-vlang-app-0.1.0.tar.gz::https://github.com/Create-Vlang-App/create-vlang-app/archive/refs/tags/create-vlang-app@0.1.0.tar.gz + sha256sums = f7c1f62f8eab3bcd4e55b05700924c864f182247ff7c050c39884f5013592729 pkgname = create-vlang-app diff --git a/.github/workflows/validate-pkgbuild.yml b/.github/workflows/validate-pkgbuild.yml index fd09d1f..00e5314 100644 --- a/.github/workflows/validate-pkgbuild.yml +++ b/.github/workflows/validate-pkgbuild.yml @@ -9,37 +9,61 @@ on: permissions: contents: read +# Never install V from the AUR `vlang` package (stale). Match create-vlang-app CI: +# vlang/setup-v on ubuntu, then run makepkg inside an Arch container with that toolchain. jobs: validate: name: makepkg + .SRCINFO sync runs-on: ubuntu-latest - container: - image: archlinux:latest steps: - - name: Install build dependencies - run: | - pacman -Sy --noconfirm --needed base-devel vlang git sudo - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - id: setup-v + uses: vlang/setup-v@12a9fab625c7fd9e51972eef71c84c3d4f41c45c + with: + version-file: .v-version + cache: true + - name: Verify .SRCINFO matches PKGBUILD run: | set -euo pipefail - makepkg --printsrcinfo > .SRCINFO.generated - diff -u .SRCINFO .SRCINFO.generated + docker run --rm \ + -v "$PWD:/work:rw" \ + -w /work \ + archlinux:latest \ + bash -euo pipefail -c ' + pacman -Sy --noconfirm --needed pacman-contrib base-devel + useradd -m builder + chown -R builder:builder /work + runuser -u builder -- makepkg --printsrcinfo > /tmp/.SRCINFO.generated + diff -u .SRCINFO /tmp/.SRCINFO.generated + ' - - name: Build package (non-root) + - name: Build package and smoke CLI (non-root) + env: + V_BIN_PATH: ${{ steps.setup-v.outputs.bin-path }} run: | set -euo pipefail - useradd -m -G wheel builder - echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers - chown -R builder:builder . - su builder -c 'makepkg -s --noconfirm --skippgpcheck' - - - name: Smoke installed CLI - run: | - su builder -c ' - set -euo pipefail - create-vlang-app --version | grep -qE "0\\.0\\.1" - create-vlang-app --help | grep -q list-templates - ' + test -n "$V_BIN_PATH" + test -x "$V_BIN_PATH/v" + docker run --rm \ + -v "$PWD:/work:rw" \ + -v "$V_BIN_PATH:$V_BIN_PATH:ro" \ + -e "PATH=${V_BIN_PATH}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + -w /work \ + archlinux:latest \ + bash -euo pipefail -c ' + pacman -Sy --noconfirm --needed base-devel git sudo + useradd -m -G wheel builder + echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + chown -R builder:builder /work + # -d: do not pull AUR/pacman makedepends; V comes from setup-v + runuser -u builder -- env "PATH=$PATH" bash -euo pipefail -c " + makepkg -d --noconfirm --skippgpcheck + pkg=\$(ls create-vlang-app-*.pkg.tar.* | grep -v -- '-debug-' | head -1) + test -n \"\$pkg\" + sudo pacman -U --noconfirm \"\$pkg\" + create-vlang-app --version | grep -qE \"[0-9]+\\.[0-9]+\\.[0-9]+\" + create-vlang-app --help | grep -q list-templates + " + ' diff --git a/.v-version b/.v-version new file mode 100644 index 0000000..cb0c939 --- /dev/null +++ b/.v-version @@ -0,0 +1 @@ +0.5.2 diff --git a/PKGBUILD b/PKGBUILD index d944da8..e6cd539 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,7 +7,8 @@ arch=('x86_64' 'aarch64') url="https://github.com/Create-Vlang-App/create-vlang-app" license=('MIT') depends=('git') -makedepends=('vlang') +# Build requires the V compiler from https://github.com/vlang/v (official bootstrap / +# vlang/setup-v). Do NOT use the AUR `vlang` package — it is outdated and unused in CI. # GitHub tag archive for create-vlang-app@0.1.0 _tag="create-vlang-app@${pkgver}" _srcdir="create-vlang-app-create-vlang-app-${pkgver}" diff --git a/README.md b/README.md index 23b0809..e7c93ec 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,17 @@ paru -S create-vlang-app ## Manual build +Requires the **official V toolchain** (not the AUR `vlang` package — it is outdated). +Same pin as CI: [`.v-version`](.v-version) via [`vlang/setup-v`](https://github.com/vlang/setup-v) or https://github.com/vlang/v. + ```bash +# Example: bootstrap V 0.5.2, then build the package +git clone --depth 1 --branch 0.5.2 https://github.com/vlang/v ~/v && make -C ~/v +export PATH="$HOME/v:$PATH" + git clone https://github.com/Create-Vlang-App/aur-package.git cd aur-package -makepkg -si +makepkg -d -si # -d: skip pacman deps; V is already on PATH ``` ## Other channels