Skip to content

Commit 119e41f

Browse files
committed
Generate tarball on every tag release
This will create a custom tarball with only the necessary items for our release. No more development/project specific will be included in the tarball. The github ones will still be there, but ours will be refined.
1 parent f07baa8 commit 119e41f

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Generate release-artifacts
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
generate:
13+
name: Generate cross-platform builds
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: olegtarasov/get-tag@v2.1
17+
id: tagName
18+
with:
19+
tagRegex: "v(.*)" # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
20+
tagRegexGroup: 1 # Optional. Default is 1.
21+
22+
- name: Checkout the repository
23+
uses: actions/checkout@v4
24+
25+
- uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.21'
28+
29+
- name: Generate distribution tarball
30+
run: |
31+
mkdir dist && make distribution-tarball
32+
sudo mv *.tar.gz dist/
33+
env:
34+
VERSION: '${{ steps.tagName.outputs.tag }}'
35+
36+
- name: Upload binaries to release
37+
uses: svenstaro/upload-release-action@v2
38+
with:
39+
repo_token: ${{ secrets.GITHUB_TOKEN }}
40+
file: dist/*
41+
tag: ${{ github.ref }}
42+
overwrite: true
43+
file_glob: true

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ clean: ## Clean project files
8585
.tox \
8686
junit.xml \
8787
coverage.xml \
88+
.mypy_cache \
8889
$(PKGNAME)-$(VERSION).tar.gz
8990
$(MAKE) -C docs clean
9091
$(MAKE) -C data/release/selinux
@@ -139,7 +140,17 @@ distribution-tarball: clean ## Generate distribution tarball
139140
--exclude=scripts \
140141
--exclude=docs \
141142
--exclude=tests \
142-
--exclude=.roproject \
143+
--exclude=.ropeproject \
144+
--exclude=.gitlab-ci.yml \
145+
--exclude=.readthedocs.yaml \
146+
--exclude=podman-compose.yaml \
147+
--exclude=schemas \
148+
--exclude=tox.ini \
149+
--exclude=renovate.json \
150+
--exclude=.pre-commit-config.yaml \
151+
--exclude=.packit.yaml \
152+
--exclude=sonar-project.properties \
153+
--exclude=poetry.toml \
143154
--transform s/^\./$(PKGNAME)-$(VERSION)/ \
144155
. && mv /tmp/$(PKGNAME)-$(VERSION).tar.gz .
145156

packaging/command-line-assistant.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Summary: A simple wrapper to interact with RAG
1616

1717
License: Apache-2.0
1818
URL: https://github.com/rhel-lightspeed/command-line-assistant
19-
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
19+
Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
2020
# noarch because there is no extension module for this package.
2121
BuildArch: noarch
2222

0 commit comments

Comments
 (0)