6565 steps :
6666 - uses : actions/checkout@v4
6767 with :
68- ref : main
68+ ref : release
6969
7070 - name : Get version from package.json
7171 id : version
@@ -76,33 +76,56 @@ jobs:
7676 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7777 run : |
7878 VERSION="${{ steps.version.outputs.VERSION }}"
79- gh release download "v${VERSION}" --pattern "*.sig" --dir ./signatures || true
79+ echo "Downloading signatures for version v${VERSION}"
80+ gh release download "v${VERSION}" --pattern "*.sig" --dir ./signatures
81+ echo "Downloaded signature files:"
82+ ls -la ./signatures/ || echo "No signatures found"
8083
8184 - name : Update latest.json
8285 run : |
8386 VERSION="${{ steps.version.outputs.VERSION }}"
8487 PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
8588
86- # Read signatures
89+ # Read signatures with better error handling
8790 WIN_SIG=""
8891 LINUX_SIG=""
8992 MACOS_X64_SIG=""
9093 MACOS_ARM_SIG=""
9194
92- if [ -f "./signatures/dota-keeper_${VERSION}_x64_en-US.msi.zip.sig" ]; then
93- WIN_SIG=$(cat "./signatures/dota-keeper_${VERSION}_x64_en-US.msi.zip.sig")
95+ # Windows signature
96+ WIN_SIG_FILE=$(find ./signatures -name "*x64_en-US.msi.zip.sig" -o -name "*x64-setup.exe.sig" | head -n 1)
97+ if [ -n "$WIN_SIG_FILE" ] && [ -f "$WIN_SIG_FILE" ]; then
98+ WIN_SIG=$(cat "$WIN_SIG_FILE")
99+ echo "Found Windows signature: $WIN_SIG_FILE"
100+ else
101+ echo "Warning: Windows signature not found"
94102 fi
95103
96- if [ -f "./signatures/dota-keeper_${VERSION}_amd64.AppImage.tar.gz.sig" ]; then
97- LINUX_SIG=$(cat "./signatures/dota-keeper_${VERSION}_amd64.AppImage.tar.gz.sig")
104+ # Linux signature
105+ LINUX_SIG_FILE=$(find ./signatures -name "*amd64.AppImage.tar.gz.sig" -o -name "*.AppImage.tar.gz.sig" | head -n 1)
106+ if [ -n "$LINUX_SIG_FILE" ] && [ -f "$LINUX_SIG_FILE" ]; then
107+ LINUX_SIG=$(cat "$LINUX_SIG_FILE")
108+ echo "Found Linux signature: $LINUX_SIG_FILE"
109+ else
110+ echo "Warning: Linux signature not found"
98111 fi
99112
100- if [ -f "./signatures/dota-keeper_x64.app.tar.gz.sig" ]; then
101- MACOS_X64_SIG=$(cat "./signatures/dota-keeper_x64.app.tar.gz.sig")
113+ # macOS x64 signature
114+ MACOS_X64_SIG_FILE=$(find ./signatures -name "*x64.app.tar.gz.sig" | head -n 1)
115+ if [ -n "$MACOS_X64_SIG_FILE" ] && [ -f "$MACOS_X64_SIG_FILE" ]; then
116+ MACOS_X64_SIG=$(cat "$MACOS_X64_SIG_FILE")
117+ echo "Found macOS x64 signature: $MACOS_X64_SIG_FILE"
118+ else
119+ echo "Warning: macOS x64 signature not found"
102120 fi
103121
104- if [ -f "./signatures/dota-keeper_aarch64.app.tar.gz.sig" ]; then
105- MACOS_ARM_SIG=$(cat "./signatures/dota-keeper_aarch64.app.tar.gz.sig")
122+ # macOS ARM signature
123+ MACOS_ARM_SIG_FILE=$(find ./signatures -name "*aarch64.app.tar.gz.sig" | head -n 1)
124+ if [ -n "$MACOS_ARM_SIG_FILE" ] && [ -f "$MACOS_ARM_SIG_FILE" ]; then
125+ MACOS_ARM_SIG=$(cat "$MACOS_ARM_SIG_FILE")
126+ echo "Found macOS ARM signature: $MACOS_ARM_SIG_FILE"
127+ else
128+ echo "Warning: macOS ARM signature not found"
106129 fi
107130
108131 # Update latest.json
@@ -132,10 +155,9 @@ jobs:
132155 }
133156 EOF
134157
135- - name : Commit and push latest.json
158+ - name : Upload latest.json to release
159+ env :
160+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
136161 run : |
137- git config user.name "github-actions[bot]"
138- git config user.email "github-actions[bot]@users.noreply.github.com"
139- git add meta/autoupdate/latest.json
140- git commit -m "chore: update latest.json for v${{ steps.version.outputs.VERSION }}"
141- git push origin main
162+ VERSION="${{ steps.version.outputs.VERSION }}"
163+ gh release upload "v${VERSION}" meta/autoupdate/latest.json --clobber
0 commit comments