Skip to content

Commit f191051

Browse files
committed
test: fix release workflow binary naming collision
1 parent a325b77 commit f191051

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/release-server.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,25 @@ jobs:
5858
- name: Build quickmark-server
5959
run: cargo build --release --bin quickmark-server --target ${{ matrix.target }}
6060

61-
- name: Prepare binary name
62-
id: binary-name
61+
- name: Prepare binary archive
62+
id: binary-archive
6363
shell: bash
6464
run: |
65-
BINARY_NAME="quickmark-server-${{ matrix.target }}${{ matrix.suffix }}"
66-
echo "binary_name=$BINARY_NAME" >> $GITHUB_OUTPUT
65+
ARCHIVE_NAME="quickmark-server-${{ matrix.target }}.tar.gz"
66+
echo "archive_name=$ARCHIVE_NAME" >> $GITHUB_OUTPUT
6767
echo "source_path=target/${{ matrix.target }}/release/quickmark-server${{ matrix.suffix }}" >> $GITHUB_OUTPUT
68+
69+
# Create archive with the binary renamed to quickmark-server
70+
mkdir -p archive-temp
71+
cp "${{ matrix.target == 'x86_64-pc-windows-msvc' && 'target/${{ matrix.target }}/release/quickmark-server.exe' || 'target/${{ matrix.target }}/release/quickmark-server' }}" archive-temp/quickmark-server${{ matrix.suffix }}
72+
tar -czf "$ARCHIVE_NAME" -C archive-temp quickmark-server${{ matrix.suffix }}
73+
rm -rf archive-temp
6874
6975
- name: Upload binary artifact
7076
uses: actions/upload-artifact@v4
7177
with:
72-
name: ${{ steps.binary-name.outputs.binary_name }}
73-
path: ${{ steps.binary-name.outputs.source_path }}
78+
name: ${{ steps.binary-archive.outputs.archive_name }}
79+
path: ${{ steps.binary-archive.outputs.archive_name }}
7480
if-no-files-found: error
7581

7682
publish:
@@ -130,24 +136,24 @@ jobs:
130136
with:
131137
path: artifacts
132138

133-
- name: Organize binaries and changelog
139+
- name: Organize archives and changelog
134140
run: |
135-
mkdir -p release-binaries
136-
# Copy binaries from artifact subdirectories
141+
mkdir -p release-archives
142+
# Copy tar.gz archives from artifact subdirectories
137143
for artifact_dir in artifacts/quickmark-server-*; do
138144
if [ -d "$artifact_dir" ]; then
139-
cp "$artifact_dir"/* release-binaries/
145+
cp "$artifact_dir"/*.tar.gz release-archives/ 2>/dev/null || true
140146
fi
141147
done
142148
# Copy changelog
143149
cp artifacts/changelog/CHANGELOG.md ./ 2>/dev/null || echo "No changelog found"
144-
ls -la release-binaries/
150+
ls -la release-archives/
145151
if [ -f CHANGELOG.md ]; then ls -la CHANGELOG.md; fi
146152
147153
- name: Create release
148154
uses: softprops/action-gh-release@v2
149155
with:
150-
files: release-binaries/*
156+
files: release-archives/*
151157
body_path: CHANGELOG.md
152158
draft: false
153159
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}

0 commit comments

Comments
 (0)