diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8e3fac..1d72376 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -189,12 +189,15 @@ jobs: run: | VERSION=$(grep -m1 'version =' Cargo.toml | cut -d '"' -f2) sed -i "s/pkgver=.*/pkgver=$VERSION/" dist/arch/PKGBUILD - cp dist/arch/PKGBUILD . + mkdir -p /tmp/pkg/src + cp -r . /tmp/pkg/src/modbus-relay + cp dist/arch/PKGBUILD /tmp/pkg - name: Build package run: | + cd /tmp/pkg chown -R nobody:nobody . - runuser -u nobody -- makepkg -s --noconfirm + runuser -p -u nobody -g root -- makepkg -s --noconfirm - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/dist/arch/PKGBUILD b/dist/arch/PKGBUILD index 75a743c..42e9e6f 100644 --- a/dist/arch/PKGBUILD +++ b/dist/arch/PKGBUILD @@ -11,10 +11,13 @@ makedepends=('cargo' 'git') backup=('etc/modbus-relay/config.yaml') build() { + cd "$srcdir/$pkgname" cargo build --release } package() { + cd "$srcdir/$pkgname" + # Binary install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"