From d6c2679416e144ddbae6e588405e356c5764384c Mon Sep 17 00:00:00 2001 From: Matthew Rich Date: Sun, 26 May 2024 02:05:18 -0700 Subject: [PATCH] add rpm spec --- .gitea/workflows/release.yaml | 25 ++++++++++++++++++++- Makefile | 3 +++ build/jx.spec | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 build/jx.spec diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index d455c6d..fc04041 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -11,8 +11,31 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + container: + image: fedora:latest + env: + GOPATH: / + SSH_AUTH_SOCK: /tmp/ssh.sock + ENVIRONMENT: dev + volumes: + - "/etc/timezone:/etc/timezone:ro" + - "/etc/localtime:/etc/localtime:ro" + - "/etc/gitconfig:/etc/gitconfig:ro" + - "/${{ env.SSH_AUTH_SOCK }}:/tmp/ssh.sock" + - "/opt/gitea/act_runner/.ssh/known_hosts:/root/.ssh/known_hosts" + - "/opt/gitea/act_runner/.gitconfig:/root/.gitconfig:ro" + - "/opt/gitea/act_runner/.git-credentials:/root/.git-credentials:ro" + - "/etc/ssl/certs:/etc/ssl/certs:ro" + options: --cpus 10 steps: - uses: actions/checkout@v3 + - run: echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV + - run: dnf install -y dnf-plugins-core + - run: dnf builddep build/jx.spec + - run: make rpm - uses: ncipollo/release-action@v1 with: - artifacts: "jx" + artifacts: + - "jx" + - "/root/rpmbuild/SRPMS/jx-${{ env.VERSION }}-1.fc40.src.rpm" + - "/root/rpmbuild/RPMS/x86_64/jx-${{ env.VERSION }}-1.fc40.x86_64.rpm" diff --git a/Makefile b/Makefile index f2f81e9..88285b0 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,6 @@ jx-cli: test: jx-cli go test -coverprofile=artifacts/coverage.profile ./... go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html + +rpm: + rpmbuild -ba build/jx.spec diff --git a/build/jx.spec b/build/jx.spec new file mode 100644 index 0000000..99da4d0 --- /dev/null +++ b/build/jx.spec @@ -0,0 +1,42 @@ +Name: jx +Version: 0.2.2 +Release: %{!?rel:1}%{?dist} +Summary: Provision resources using a declarative YAML syntax. + +License: https://gitea.rosskeen.house/doublejynx/jx/src/branch/main/LICENSE +URL: https://gitea.rosskeen.house/doublejynx/jx/ +Source0: https://gitea.rosskeen.house/doublejynx/jx/archive/v0.2.2.tar.gz + +BuildRequires: luajit-devel +BuildRequires: make +BuildRequires: golang >= 1.22.1 +Requires: luajit + +%description + +%global debug_package %{nil} +%undefine _missing_build_ids_terminate_build +%global _missing_build_ids_terminate_build 0 + +%prep +%autosetup -n jx + + +%build +LDFLAGS= +%make_build + + +%install +mkdir -p %{buildroot}/usr/bin +cp jx %{buildroot}/usr/bin/jx + +%files +%license LICENSE +#%doc add-docs-here +%{_bindir}/jx + + +%changelog +* Sun May 26 2024 Matthew Rich v0.2.2 +-