Skip to content

Commit ef89334

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents c7d067d + 646cbaf commit ef89334

6 files changed

Lines changed: 86 additions & 47 deletions

File tree

.github/workflows/javadoc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ jobs:
3232
uses: peaceiris/actions-gh-pages@v4
3333
with:
3434
github_token: ${{ secrets.GITHUB_TOKEN }}
35-
publish_dir: ./app/build/docs/javadoc
35+
publish_dir: ./app/build/docs/javadoc
36+
force_orphan: true

.github/workflows/release.yml

Lines changed: 61 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,43 @@ on:
99
types: [created]
1010

1111
jobs:
12-
build-and-upload:
12+
build-assets:
1313
runs-on: ubuntu-latest
1414
permissions:
15-
contents: write
15+
contents: read
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
target:
20+
- name: jar
21+
command: ./gradlew build && cp app/build/libs/app-all.jar NumberGuessingGame.jar
22+
artifact: NumberGuessingGame.jar
23+
path: ./NumberGuessingGame.jar
24+
- name: deb
25+
command: ./package-deb.sh
26+
artifact: NumberGuessingGame.deb
27+
path: ./NumberGuessingGame.deb
28+
- name: rpm
29+
command: ./package-rpm.sh
30+
artifact: NumberGuessingGame.rpm
31+
path: ./NumberGuessingGame.rpm
32+
needsRpmTools: true
33+
- name: zip
34+
command: ./package-zip.sh
35+
artifact: NumberGuessingGame-archive.zip
36+
path: ./NumberGuessingGame-archive.zip
37+
- name: windows
38+
command: ./package-win.sh
39+
artifact: NumberGuessingGame-windows.zip
40+
path: ./NumberGuessingGame-windows.zip
41+
- name: macos
42+
command: ./package-macos.sh
43+
artifact: NumberGuessingGame-macos.zip
44+
path: ./NumberGuessingGame-macos.zip
45+
- name: linux
46+
command: ./package-linux.sh
47+
artifact: NumberGuessingGame-linux.tar.xz
48+
path: ./NumberGuessingGame-linux.tar.xz
1649

1750
steps:
1851
- name: Checkout code
@@ -27,38 +60,40 @@ jobs:
2760
- name: Setup Gradle
2861
uses: gradle/actions/setup-gradle@v5
2962

30-
- name: Build JAR with Gradle
31-
run: ./gradlew build
32-
33-
- name: Build Debian package
34-
run: ./package-deb.sh
35-
3663
- name: Install RPM build tools
64+
if: ${{ matrix.target.needsRpmTools }}
3765
run: sudo apt-get update && sudo apt-get install -y rpm
3866

39-
- name: Build Fedora/RPM package
40-
run: ./package-rpm.sh
67+
- name: Build ${{ matrix.target.name }}
68+
run: ${{ matrix.target.command }}
4169

42-
- name: Build ZIP archive
43-
run: ./package-zip.sh
44-
45-
- name: Build Windows package with bundled JRE
46-
run: ./package-win.sh
70+
- name: Upload ${{ matrix.target.name }} artifact
71+
uses: actions/upload-artifact@v6
72+
with:
73+
name: ${{ matrix.target.artifact }}
74+
path: ${{ matrix.target.path }}
75+
if-no-files-found: error
4776

48-
- name: Build macOS package with bundled JRE
49-
run: ./package-macos.sh
77+
create-release:
78+
runs-on: ubuntu-latest
79+
needs: build-assets
80+
permissions:
81+
contents: write
5082

51-
- name: Build Linux package with bundled JRE
52-
run: ./package-linux.sh
83+
steps:
84+
- name: Download artifacts
85+
uses: actions/download-artifact@v7
86+
with:
87+
path: dist
5388

5489
- name: Upload release assets
5590
uses: softprops/action-gh-release@v2
5691
with:
5792
files: |
58-
./app/build/libs/app-all.jar
59-
./numberguessinggame.deb
60-
./numberguessinggame-*.rpm
61-
./archive.zip
62-
./NumberGuessingGame-windows.zip
63-
./NumberGuessingGame-macos.zip
64-
./NumberGuessingGame-linux.tar.xz
93+
dist/NumberGuessingGame.jar/NumberGuessingGame.jar
94+
dist/NumberGuessingGame.deb/NumberGuessingGame.deb
95+
dist/NumberGuessingGame.rpm/NumberGuessingGame.rpm
96+
dist/NumberGuessingGame-archive.zip/NumberGuessingGame-archive.zip
97+
dist/NumberGuessingGame-windows.zip/NumberGuessingGame-windows.zip
98+
dist/NumberGuessingGame-macos.zip/NumberGuessingGame-macos.zip
99+
dist/NumberGuessingGame-linux.tar.xz/NumberGuessingGame-linux.tar.xz

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@ gradle-app.setting
2727
# Ignore Gradle build output directory
2828
build
2929

30-
archive.zip
31-
numberguessinggame.deb
32-
numberguessinggame-*.rpm
33-
3430
# JRE bundling artifacts
3531
jre-windows/
3632
jre-macos/
3733
jre-linux/
34+
35+
# Unzipped artifacts
3836
NumberGuessingGame-windows/
3937
NumberGuessingGame-macos/
4038
NumberGuessingGame-linux/
39+
40+
# Packaged artifacts
4141
NumberGuessingGame-windows.zip
4242
NumberGuessingGame-macos.zip
4343
NumberGuessingGame-linux.tar.xz
44+
NumberGuessingGame.rpm
45+
NumberGuessingGame.deb
46+
NumberGuessingGame.jar

package-deb.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Script to create a Debian package (.deb) for Number Guessing Game
88
# This package can be installed on Debian-based Linux distributions (Ubuntu, Mint, etc.)
99
# Usage: ./package-deb.sh
10-
# Output: numberguessinggame.deb
10+
# Output: NumberGuessingGame.deb
1111

1212
# Exit immediately if any command fails
1313
set -e
@@ -17,7 +17,7 @@ echo "Building Number Guessing Game Debian package..."
1717
# Clean up any previous build artifacts
1818
echo "Cleaning up previous builds..."
1919
rm -rf debian-package/usr/share/games/numberguessinggame/*
20-
rm -f numberguessinggame.deb
20+
rm -f NumberGuessingGame.deb
2121

2222
# Build the application using Gradle
2323
echo "Building application..."
@@ -40,16 +40,16 @@ chmod 755 debian-package/usr/games/numberguessinggame
4040

4141
# Build the .deb package using dpkg-deb
4242
echo "Building .deb package..."
43-
dpkg-deb --build debian-package numberguessinggame.deb
43+
dpkg-deb --build debian-package NumberGuessingGame.deb
4444

4545
# Display success message with installation instructions
4646
echo ""
47-
echo "✓ Debian package created: numberguessinggame.deb"
47+
echo "✓ Debian package created: NumberGuessingGame.deb"
4848
echo ""
4949
echo "To install, run:"
50-
echo " sudo apt install ./numberguessinggame.deb"
50+
echo " sudo apt install ./NumberGuessingGame.deb"
5151
echo " sudo apt install -f # to install any missing dependencies"
5252
echo ""
5353
echo "After installation, run the game with:"
5454
echo " numberguessinggame"
55-
echo ""
55+
echo ""

package-rpm.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Script to create a Fedora/RPM package (.rpm) for Number Guessing Game
88
# This package can be installed on Fedora, RHEL, CentOS, and other RPM-based distributions
99
# Usage: ./package-rpm.sh
10-
# Output: numberguessinggame-1.0.0-1.noarch.rpm
10+
# Output: NumberGuessingGame.rpm
1111

1212
# Exit immediately if any command fails
1313
set -e
@@ -27,7 +27,7 @@ echo "Cleaning up previous builds..."
2727
rm -rf ~/rpmbuild/RPMS/noarch/numberguessinggame-*.rpm
2828
rm -rf ~/rpmbuild/BUILD/numberguessinggame-*
2929
rm -rf ~/rpmbuild/BUILDROOT/numberguessinggame-*
30-
rm -f numberguessinggame-*.rpm
30+
rm -f NumberGuessingGame.rpm
3131

3232
# Build the application using Gradle
3333
echo "Building application..."
@@ -55,18 +55,18 @@ rpmbuild -bb ~/rpmbuild/SPECS/numberguessinggame.spec
5555

5656
# Copy the built RPM to the current directory
5757
echo "Copying RPM package to current directory..."
58-
cp ~/rpmbuild/RPMS/noarch/numberguessinggame-*.rpm ./numberguessinggame.rpm
58+
cp ~/rpmbuild/RPMS/noarch/numberguessinggame-*.rpm ./NumberGuessingGame.rpm
5959

6060
# Display success message with installation instructions
6161
echo ""
62-
echo "✓ RPM package created: $(ls numberguessinggame-*.rpm)"
62+
echo "✓ RPM package created: $(ls NumberGuessingGame.rpm)"
6363
echo ""
6464
echo "To install on Fedora/RHEL/CentOS, run:"
65-
echo " sudo dnf install ./numberguessinggame-*.rpm"
65+
echo " sudo dnf install ./NumberGuessingGame.rpm"
6666
echo ""
6767
echo "Or on older systems:"
68-
echo " sudo yum install ./numberguessinggame-*.rpm"
68+
echo " sudo yum install ./NumberGuessingGame.rpm"
6969
echo ""
7070
echo "After installation, run the game with:"
7171
echo " numberguessinggame"
72-
echo ""
72+
echo ""

package-zip.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Clean up any previous builds
1111
rm -rf NumberGuessingGame
1212
rm -rf temp
13-
rm -f archive.zip
13+
rm -f NumberGuessingGame-archive.zip
1414

1515
# Build the application
1616
cd app
@@ -28,7 +28,7 @@ cp -r README.md NumberGuessingGame/README.txt
2828
cp -r LICENSE NumberGuessingGame/LICENSE
2929

3030
# Create the ZIP archive with maximum compression
31-
zip -9 -r archive.zip NumberGuessingGame/
31+
zip -9 -r NumberGuessingGame-archive.zip NumberGuessingGame/
3232

3333
# Clean up temporary directory
34-
rm -rf NumberGuessingGame
34+
rm -rf NumberGuessingGame

0 commit comments

Comments
 (0)