@@ -140,31 +140,31 @@ jobs:
140140 run : |
141141 mkdir -p release
142142
143- # Determine platform name (matching goreleaser naming convention)
144- OS_NAME="${{ matrix.goos == 'darwin' && 'Darwin' || matrix.goos == 'windows' && 'Windows' || 'Linux' }}"
145- ARCH_NAME="${{ matrix.goarch == 'amd64' && 'x86_64' || matrix.goarch }}"
146- PLATFORM_NAME="sstart_${OS_NAME}_${ARCH_NAME}"
143+ # Use lowercase OS and arch names for the archive filename
144+ # Format: sstart-{VERSION}-{os}-{arch}.tar.gz
145+ OS_NAME="${{ matrix.goos }}"
146+ ARCH_NAME="${{ matrix.goarch }}"
147+ ARCHIVE_NAME="sstart-${{ steps.version.outputs.version }}-${OS_NAME}-${ARCH_NAME}"
147148
148- # Create platform directory
149- mkdir -p "${PLATFORM_NAME}"
149+ # Create temporary directory for archive contents
150+ TEMP_DIR=$(mktemp -d)
150151
151- # Copy binary
152- cp ${{ matrix.binary_name }} "${PLATFORM_NAME }/sstart${{ matrix.goos == 'windows' && '.exe' || '' }} "
152+ # Copy binary to temp directory
153+ cp ${{ matrix.binary_name }} "${TEMP_DIR }/sstart"
153154
154- # Copy LICENSE and README
155- cp LICENSE README.md "${PLATFORM_NAME }/" 2>/dev/null || true
155+ # Copy LICENSE and README if they exist
156+ cp LICENSE README.md "${TEMP_DIR }/" 2>/dev/null || true
156157
157- # Create archive
158- if [ "${{ matrix.goos }}" == "windows" ]; then
159- cd "${PLATFORM_NAME}"
160- zip -r "../release/${PLATFORM_NAME}.zip" .
161- cd ..
162- else
163- tar -czf "release/${PLATFORM_NAME}.tar.gz" "${PLATFORM_NAME}"
164- fi
158+ # Create archive with binary at root (not in a subdirectory)
159+ # Use -C to change into temp directory and archive contents directly
160+ tar -czf "release/${ARCHIVE_NAME}.tar.gz" -C "${TEMP_DIR}" .
165161
166162 # Clean up
167- rm -rf "${PLATFORM_NAME}"
163+ rm -rf "${TEMP_DIR}"
164+
165+ # Verify archive structure (binary should be at root)
166+ echo "Archive contents:"
167+ tar -tzf "release/${ARCHIVE_NAME}.tar.gz" | head -10
168168
169169 - name : Upload build artifacts
170170 uses : actions/upload-artifact@v4
0 commit comments