diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index e822617..0175fca 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -171,30 +171,21 @@ jobs: set -euo pipefail VERSION="${{ github.event.inputs.tag || github.ref_name }}" PKGVER="${VERSION#v}" - GO_ROOT="$(go env GOROOT)" + + sudo apt-get install -y rpm git archive --format=tar.gz --prefix=pgtidy-${PKGVER}/ HEAD \ > pgtidy-${PKGVER}.tar.gz sed -i "s/^Version:.*/Version: ${PKGVER}/" linux/centos/pgtidy.spec + mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} + cp pgtidy-${PKGVER}.tar.gz ~/rpmbuild/SOURCES/ + cp linux/centos/pgtidy.spec ~/rpmbuild/SPECS/ + rpmbuild --nodeps -ba ~/rpmbuild/SPECS/pgtidy.spec + mkdir -p rpm-out - docker run --rm \ - -v "$(pwd):/build" \ - -v "${GO_ROOT}:/usr/local/go:ro" \ - -e PKGVER="${PKGVER}" \ - -w /build \ - rockylinux:9 \ - bash -lc " - set -euo pipefail - export PATH=\$PATH:/usr/local/go/bin && - dnf install -y rpm-build git && - mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} && - cp pgtidy-${PKGVER}.tar.gz ~/rpmbuild/SOURCES/ && - cp linux/centos/pgtidy.spec ~/rpmbuild/SPECS/ && - rpmbuild --nodeps -ba ~/rpmbuild/SPECS/pgtidy.spec && - find ~/rpmbuild/RPMS/ -name '*.rpm' -exec cp {} /build/rpm-out/ \; - " + find ~/rpmbuild/RPMS/ -name '*.rpm' -exec cp {} rpm-out/ \; - name: Upload to release run: |