@@ -23,13 +23,17 @@ jobs:
2323 - name : Install dependencies
2424 run : npm install
2525
26+ - name : Get package version
27+ id : package_version
28+ run : echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
29+
2630 - name : Build the app
2731 run : npm run make
2832
2933 - name : Upload build artifacts
3034 uses : actions/upload-artifact@v4
3135 with :
32- name : lottiesync- ${{ github.ref_name }}-linux
36+ name : pubgmhud-sync- ${{ steps.package_version.outputs.version }}-linux
3337 path : out/make/**
3438 retention-days : 1
3539
@@ -47,13 +51,18 @@ jobs:
4751 - name : Install dependencies
4852 run : npm install
4953
54+ - name : Get package version
55+ id : package_version
56+ shell : bash
57+ run : echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
58+
5059 - name : Build the app
5160 run : npm run make
5261
5362 - name : Upload build artifacts
5463 uses : actions/upload-artifact@v4
5564 with :
56- name : lottiesync- ${{ github.ref_name }}-windows
65+ name : pubgmhud-sync- ${{ steps.package_version.outputs.version }}-windows
5766 path : out/make/**
5867 retention-days : 1
5968
@@ -63,16 +72,23 @@ jobs:
6372 if : startsWith(github.ref, 'refs/tags/v')
6473
6574 steps :
75+ - name : Checkout code
76+ uses : actions/checkout@v4
77+
78+ - name : Get package version
79+ id : package_version
80+ run : echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
81+
6682 - name : Download build artifacts (linux)
6783 uses : actions/download-artifact@v4
6884 with :
69- name : lottiesync- ${{ github.ref_name }}-linux
85+ name : pubgmhud-sync- ${{ steps.package_version.outputs.version }}-linux
7086 path : out/linux/
7187
7288 - name : Download build artifacts (windows)
7389 uses : actions/download-artifact@v4
7490 with :
75- name : lottiesync- ${{ github.ref_name }}-windows
91+ name : pubgmhud-sync- ${{ steps.package_version.outputs.version }}-windows
7692 path : out/windows/
7793
7894 - name : Create Release
@@ -86,57 +102,32 @@ jobs:
86102 draft : false
87103 prerelease : false
88104
89- - name : Debug - List downloaded files
90- run : |
91- echo "=== Linux files ==="
92- find ./out/linux -type f 2>/dev/null || echo "No linux directory found"
93- echo "=== Windows files ==="
94- find ./out/windows -type f 2>/dev/null || echo "No windows directory found"
95- echo "=== Current directory ==="
96- pwd
97- ls -la
98-
99- - name : Find and Upload Linux RPM
100- run : |
101- echo "Searching for RPM files in ./out/linux/rpm/x64/"
102- ls -la ./out/linux/rpm/x64/ 2>/dev/null || echo "Directory not found"
103- RPM_FILE=$(find ./out/linux/rpm/x64 -name "*.rpm" -type f 2>/dev/null | head -1)
104- if [ -n "$RPM_FILE" ]; then
105- echo "Found RPM file: $RPM_FILE"
106- gh release upload ${{ github.ref_name }} "$RPM_FILE" --repo ${{ github.repository }} --clobber
107- else
108- echo "No RPM file found"
109- exit 1
110- fi
105+ - name : Upload Release Asset (Linux RPM)
106+ uses : actions/upload-release-asset@v1
111107 env :
112108 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
109+ with :
110+ upload_url : ${{ steps.create_release.outputs.upload_url }}
111+ asset_path : ./out/linux/rpm/x64/pubgmhud-sync-${{ steps.package_version.outputs.version }}-1.x86_64.rpm
112+ asset_name : pubgmhud-sync-linux.rpm
113+ asset_content_type : application/vnd.rpm
113114
114- - name : Find and Upload Linux DEB
115- run : |
116- echo "Searching for DEB files in ./out/linux/deb/x64/"
117- ls -la ./out/linux/deb/x64/ 2>/dev/null || echo "Directory not found"
118- DEB_FILE=$(find ./out/linux/deb/x64 -name "*.deb" -type f 2>/dev/null | head -1)
119- if [ -n "$DEB_FILE" ]; then
120- echo "Found DEB file: $DEB_FILE"
121- gh release upload ${{ github.ref_name }} "$DEB_FILE" --repo ${{ github.repository }} --clobber
122- else
123- echo "No DEB file found"
124- exit 1
125- fi
115+ - name : Upload Release Asset (Linux DEB)
116+ uses : actions/upload-release-asset@v1
126117 env :
127118 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
119+ with :
120+ upload_url : ${{ steps.create_release.outputs.upload_url }}
121+ asset_path : ./out/linux/deb/x64/pubgmhud-sync_${{ steps.package_version.outputs.version }}_amd64.deb
122+ asset_name : pubgmhud-sync-linux.deb
123+ asset_content_type : application/vnd.debian.binary-package
128124
129- - name : Find and Upload Windows EXE
130- run : |
131- echo "Searching for EXE files in ./out/windows/squirrel.windows/x64/"
132- ls -la ./out/windows/squirrel.windows/x64/ 2>/dev/null || echo "Directory not found"
133- EXE_FILE=$(find ./out/windows/squirrel.windows/x64 -name "*.exe" -type f 2>/dev/null | head -1)
134- if [ -n "$EXE_FILE" ]; then
135- echo "Found EXE file: $EXE_FILE"
136- gh release upload ${{ github.ref_name }} "$EXE_FILE" --repo ${{ github.repository }} --clobber
137- else
138- echo "No EXE file found"
139- exit 1
140- fi
125+ - name : Upload Release Asset (Windows)
126+ uses : actions/upload-release-asset@v1
141127 env :
142- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
129+ with :
130+ upload_url : ${{ steps.create_release.outputs.upload_url }}
131+ asset_path : ./out/windows/squirrel.windows/x64/PUBGMHUDSync-${{ steps.package_version.outputs.version }} Setup.exe
132+ asset_name : pubgmhud-sync-windows.exe
133+ asset_content_type : application/octet-stream
0 commit comments