Skip to content

Commit c78a042

Browse files
committed
Build manpages on pr label
1 parent f51e471 commit c78a042

File tree

11 files changed

+498
-604
lines changed

11 files changed

+498
-604
lines changed

.github/workflows/release.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Build new manpages on every release. To avoid too complicated workflows, we
2+
# will generate the manpages when we add the label "manpages" in our pull request,
3+
# indicating that this pull request will be one that will be released.
4+
5+
name: "Release"
6+
7+
on:
8+
push:
9+
tags: ["*"]
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build:
16+
name: Generate tarball
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: olegtarasov/get-tag@v2.1
20+
id: tagName
21+
with:
22+
tagRegex: "v(.*)" # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
23+
tagRegexGroup: 1 # Optional. Default is 1.
24+
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-python@v5
28+
29+
- name: Install dependencies
30+
run: |
31+
# TODO(r0x0d): Refactor this https://issues.redhat.com/browse/RSPEED-339
32+
sudo apt update -y
33+
sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 -y
34+
make install
35+
36+
- name: Generate manpages
37+
run: |
38+
echo "$(poetry env info -p)/bin" >> $GITHUB_PATH
39+
SPHINXBUILD=$(poetry env info -p)/bin/sphinx-build make man
40+
41+
- name: Generate distribution tarball
42+
run: |
43+
make distribution-tarball
44+
env:
45+
VERSION: '${{ steps.tagName.outputs.tag }}'
46+
47+
- name: Upload binaries to release
48+
uses: svenstaro/upload-release-action@v2
49+
with:
50+
repo_token: ${{ secrets.GITHUB_TOKEN }}
51+
file: command-line-assistant-${{ steps.tagName.outputs.tag }}
52+
tag: ${{ github.ref }}
53+
overwrite: true
54+
file_glob: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ data/release/selinux/clad.pp
3535
data/release/selinux/clad.pp.bz2
3636
data/release/selinux/clad.cil
3737
data/release/selinux/tmp
38+
39+
# Tarball
40+
*.tar.gz

Makefile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
reload-clad \
1212
manpages \
1313
docs \
14+
distribution-tarball \
15+
html-docs
1416

1517
# Project directory path - /home/<user>/.../command-line-assistant
1618
PROJECT_DIR := $(shell pwd)
@@ -29,6 +31,9 @@ SYSTEMD_USER_UNITS := ~/.config/systemd/user
2931
# Path to local XDG_CONFIG_DIRS to load config file
3032
XDG_CONFIG_DIRS := $(subst /,\/,$(DATA_DEVELOPMENT_PATH)/config)
3133

34+
PKGNAME := command-line-assistant
35+
VERSION := 0.2.2
36+
3237
default: help
3338

3439
install-tools: ## Install required utilities/tools
@@ -77,7 +82,8 @@ clean: ## Clean project files
7782
dist \
7883
.tox \
7984
junit.xml \
80-
coverage.xml
85+
coverage.xml \
86+
$(PKGNAME)-$(VERSION).tar.gz
8187
$(MAKE) -C docs clean
8288
$(MAKE) -C data/release/selinux
8389

@@ -113,3 +119,22 @@ man: ## Build manpages
113119

114120
html-docs: ## Build html docs
115121
$(MAKE) -C docs html
122+
123+
distribution-tarball: clean ## Generate distribution tarball
124+
tar --create \
125+
--gzip \
126+
--file /tmp/$(PKGNAME)-$(VERSION).tar.gz \
127+
--exclude=.git \
128+
--exclude=.vscode \
129+
--exclude=.github \
130+
--exclude=.gitignore \
131+
--exclude=.copr \
132+
--exclude=.venv \
133+
--exclude=.ruff_cache \
134+
--exclude=data/development \
135+
--exclude=scripts \
136+
--exclude=docs \
137+
--exclude=tests \
138+
--exclude=.roproject \
139+
--transform s/^\./$(PKGNAME)-$(VERSION)/ \
140+
. && mv /tmp/$(PKGNAME)-$(VERSION).tar.gz .

0 commit comments

Comments
 (0)