Skip to content

Commit d3a6b98

Browse files
committed
Changed binary naming to include version and also fixed cd.yml to extract the correct files [skip ci]
1 parent a7ff52e commit d3a6b98

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

.github/workflows/cd.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ jobs:
3838
tag: tag
3939
});
4040
41-
// Find the Linux binary for the selected server
42-
const serverName = '${{ inputs.server }}';
41+
// Extract version number (remove 'v' prefix)
42+
const version = tag.startsWith('v') ? tag.substring(1) : tag;
43+
44+
// Find the Linux combined archive
4345
const asset = release.assets.find(asset =>
44-
asset.name.includes(serverName) &&
45-
asset.name.includes('x86_64-unknown-linux-gnu') &&
46-
asset.name.endsWith('.tar.gz')
46+
asset.name === `hfs-${version}-x86_64-unknown-linux-gnu.tar.gz`
4747
);
4848
4949
if (!asset) {
50-
throw new Error('Linux binary not found in release assets');
50+
throw new Error(`Linux archive not found. Expected: hfs-${version}-x86_64-unknown-linux-gnu.tar.gz`);
5151
}
5252
5353
const { data } = await github.rest.repos.getReleaseAsset({
@@ -65,6 +65,8 @@ jobs:
6565
- name: Extract binary
6666
run: |
6767
tar -xzf release-binary.tar.gz
68+
# The archive contains target/release/ structure
69+
mv target/release/${{ inputs.server }} .
6870
chmod +x ${{ inputs.server }}
6971
7072
- name: Deploy binary and create service

.github/workflows/ci.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,31 +233,21 @@ jobs:
233233
- name: Create release archives
234234
run: |
235235
mkdir -p releases
236+
# Extract version from tag (remove 'v' prefix)
237+
version="${{ github.ref_name }}"
238+
version="${version#v}"
239+
236240
cd artifacts
237241
for dir in */; do
238242
# Extract target from directory name (format: hfs-{target}/)
239243
if [[ "$dir" =~ hfs-(.+)/ ]]; then
240244
target="${BASH_REMATCH[1]}"
241245
242-
# Create individual archives for each server binary
243-
for server in fhirpath-server sof-server; do
244-
if [ -f "$dir/target/release/$server" ]; then
245-
echo "Creating archive for $server on $target"
246-
if [[ "$target" == *"windows"* ]]; then
247-
# For Windows, create a zip with just the server exe
248-
cd "$dir/target/release" && zip -r ../../../../releases/${server}-${target}.zip $server.exe && cd ../../../..
249-
else
250-
# For Linux/macOS, create a tar.gz with just the server binary
251-
tar -czf releases/${server}-${target}.tar.gz -C "$dir/target/release" $server
252-
fi
253-
fi
254-
done
255-
256-
# Also create the complete archive with all binaries (for backward compatibility)
246+
# Create combined archive with version in filename
257247
if [[ "$target" == *"windows"* ]]; then
258-
cd "$dir" && zip -r ../../releases/hfs-${target}.zip . && cd ..
248+
cd "$dir" && zip -r ../../releases/hfs-${version}-${target}.zip . && cd ..
259249
else
260-
tar -czf ../releases/hfs-${target}.tar.gz -C "$dir" .
250+
tar -czf ../releases/hfs-${version}-${target}.tar.gz -C "$dir" .
261251
fi
262252
fi
263253
done

0 commit comments

Comments
 (0)