4
4
workflow_call :
5
5
inputs :
6
6
version :
7
- required : true
7
+ required : false
8
8
type : string
9
9
shasum :
10
- required : true
10
+ required : false
11
11
type : string
12
12
13
13
jobs :
@@ -22,30 +22,62 @@ jobs:
22
22
23
23
- name : Checkout repository
24
24
uses : actions/checkout@v4
25
+ with :
26
+ fetch-depth : 0
25
27
26
28
- name : Configure Git safe directory
27
29
run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
28
30
29
31
- name : Install build dependencies
30
- run : dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel
32
+ run : dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel python3-pyzstd python3-xlib wget
33
+
34
+ - name : Extract Version and SHA
35
+ run : |
36
+ # Get version from git tags (assuming semantic versioning format)
37
+ VERSION=$(git describe --tags --abbrev=0 || echo "unknown")
38
+
39
+ # Get current commit SHA
40
+ COMMIT_SHA=$(git rev-parse HEAD)
41
+
42
+ # Store values in environment file
43
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
44
+ echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
31
45
32
46
- name : Build the project
47
+ env :
48
+ VERSION : ${{ env.VERSION }}
33
49
run : |
50
+ # Use either provided input or extracted value
51
+ VERSION=${VERSION}
52
+ COMMIT_SHA=${COMMIT_SHA}
53
+
54
+ echo $VERSION
34
55
git submodule update --init --recursive
35
- ./configure.sh --prefix=/usr
36
- make
37
- mkdir -p ~/rpmbuild/SOURCES
38
- cp -r . ~/rpmbuild/SOURCES/umu-launcher
39
- sed -re '/^#%global manual_commit/s|^# ?(.*)|\1|' packaging/rpm/umu-launcher.spec \
40
- -e 's|(manual_commit\s+\w+)|manual_commit ${{ inputs.shasum }}|g' \
41
- -i
42
- cat packaging/rpm/umu-launcher.spec | grep manual_commit
56
+ sed -i "s|^VERSION := .*$|VERSION := ${VERSION}|g" Makefile.in
57
+
58
+ cd ..
59
+ mkdir -p ~/rpmbuild/SOURCES/
60
+ cp -R umu-launcher umu-launcher-$VERSION/
61
+ tar -cvzf umu-launcher-$VERSION.tar.gz umu-launcher-$VERSION
62
+ mv umu-launcher-$VERSION.tar.gz ~/rpmbuild/SOURCES/
63
+ rm -Rf umu-launcher-$VERSION/
64
+ wget https://github.com/urllib3/urllib3/releases/download/2.3.0/urllib3-2.3.0.tar.gz
65
+ mv urllib3-2.3.0.tar.gz ~/rpmbuild/SOURCES/
66
+ cd umu-launcher/
67
+
68
+ sed -i "s|^%global tag .*|%global tag ${VERSION}|g" packaging/rpm/umu-launcher.spec
69
+ cat packaging/rpm/umu-launcher.spec | grep tag
70
+
71
+ echo $COMMIT_SHA
72
+ sed -i "s|^%global commit .*|%global commit ${COMMIT_SHA}|g" packaging/rpm/umu-launcher.spec
73
+ cat packaging/rpm/umu-launcher.spec | grep commit
74
+
43
75
rpmbuild -ba packaging/rpm/umu-launcher.spec
44
- mv ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }} *.rpm \
45
- ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }} .fc40.rpm
76
+ mv ~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION *.rpm \
77
+ ~/rpmbuild/RPMS/x86_64/umu-launcher-$VERSION .fc40.rpm
46
78
47
79
- name : Fedora-40
48
80
uses : actions/upload-artifact@v4
49
81
with :
50
- name : umu-launcher-${{ inputs.version }}.fc40.rpm
51
- path : ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ inputs.version }}.fc40.rpm
82
+ name : umu-launcher-${{ env.VERSION }}.fc40.rpm
83
+ path : ~/rpmbuild/RPMS/x86_64/umu-launcher-${{ env.VERSION }}.fc40.rpm
0 commit comments