Skip to content

Commit a8900ae

Browse files
authored
Change workflow from Dev Build to Release Build
Updated workflow to change from Dev Build to Release Build, modifying version handling and artifact naming.
1 parent 17183a5 commit a8900ae

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Dev Build
1+
name: Release Build
22

33
on:
44
push:
55
branches:
6-
- dev
6+
- master
77

8-
# Opt into Node.js 24 for all actions in this workflow to resolve deprecation warnings
8+
# Resolve Node.js 20 deprecation warnings by opting into the Node 24 runner
99
env:
1010
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1111

@@ -22,43 +22,44 @@ jobs:
2222
with:
2323
distribution: 'temurin'
2424
java-version: '21'
25-
cache: 'maven'
25+
cache: 'maven' # Speeds up builds by caching dependencies
2626

27-
- name: 🏷 Get and Clean Base Version
27+
- name: 🏷 Get and Clean Version from pom.xml
2828
id: version
2929
run: |
30-
# 1. Get raw version from pom (e.g., 1.4.7 or 1.4.7-DEVBUILD.4)
30+
# 1. Extract the raw version (e.g., 1.4.7-DEVBUILD.4 or 1.4.7)
3131
RAW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
3232
33-
# 2. Strip any existing tags to get the clean base (e.g., 1.4.7)
33+
# 2. Cleaning logic: strip everything after the first hyphen
34+
# This converts "1.4.7-DEVBUILD.4" -> "1.4.7"
3435
CLEAN_VERSION=$(echo $RAW_VERSION | cut -d'-' -f1)
3536
36-
# 3. Create the new Dev version using GitHub's built-in run number
37-
DEV_VERSION="${CLEAN_VERSION}-DEVBUILD.${{ github.run_number }}"
38-
39-
echo "BASE_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
40-
echo "FINAL_VERSION=$DEV_VERSION" >> $GITHUB_ENV
41-
echo "version=$DEV_VERSION" >> $GITHUB_OUTPUT
37+
echo "VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
38+
echo "version=$CLEAN_VERSION" >> $GITHUB_OUTPUT
39+
echo "✅ Detected Raw: $RAW_VERSION -> Cleaned for Release: $CLEAN_VERSION"
4240
43-
- name: 🛠 Build with Maven
41+
- name: 🛠 Build Production JAR
4442
run: |
45-
echo "Building Development version: ${{ env.FINAL_VERSION }}"
46-
mvn clean package -Drevision=${{ env.FINAL_VERSION }}
43+
# Use -Drevision to force the clean version into the final JAR name
44+
echo "Building Release version: ${{ env.VERSION }}"
45+
mvn clean package -Drevision=${{ env.VERSION }}
4746
48-
- name: 📦 Prepare Dev Artifacts
47+
- name: 📦 Prepare Release Artifacts
4948
run: |
5049
mkdir -p dist
51-
JAR=$(find target -name "AutoPickup-${{ env.FINAL_VERSION }}.jar" | head -n1)
50+
# Find the JAR matching the clean version
51+
JAR=$(find target -name "AutoPickup-${{ env.VERSION }}.jar" | head -n1)
5252
5353
if [ -z "$JAR" ]; then
54-
echo "❌ No JAR found for version ${{ env.FINAL_VERSION }}"
54+
echo "❌ Expected JAR target/AutoPickup-${{ env.VERSION }}.jar not found"
55+
ls -l target
5556
exit 1
5657
fi
5758
58-
cp "$JAR" "dist/AutoPickup-${{ env.FINAL_VERSION }}.jar"
59+
cp "$JAR" "dist/AutoPickup-${{ env.VERSION }}.jar"
5960
60-
- name: 📥 Upload Dev Build Artifact
61+
- name: 📥 Upload Release Artifact
6162
uses: actions/upload-artifact@v4
6263
with:
63-
name: AutoPickup-${{ env.FINAL_VERSION }}
64+
name: AutoPickup-${{ env.VERSION }}-RELEASE
6465
path: dist/*.jar

0 commit comments

Comments
 (0)