Skip to content

Commit cc7318f

Browse files
authored
Update release.yml
preferred the previous way
1 parent d4784c1 commit cc7318f

1 file changed

Lines changed: 9 additions & 39 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,54 +28,28 @@ jobs:
2828
run: |
2929
echo "Checking artifacts..."
3030
ls -R artifacts || true
31-
count=$(find artifacts -type f | wc -l)
32-
if [ "$count" -eq 0 ]; then
31+
if [ ! "$(find artifacts -type f | wc -l)" -gt 0 ]; then
3332
echo "No artifacts found. Failing release job."
3433
exit 1
3534
fi
3635
37-
- name: Create packages by platform
36+
- name: Create packages
3837
shell: bash
3938
run: |
40-
mkdir -p packages
41-
declare -A platform_dirs
42-
platform_dirs[windows]=""
43-
platform_dirs[ubuntu]=""
44-
platform_dirs[macos]=""
45-
46-
# assign folders to exact platform names
47-
for dir in artifacts/*; do
48-
if [ -d "$dir" ]; then
49-
name=$(basename "$dir" | tr '[:upper:]' '[:lower:]')
50-
case "$name" in
51-
*windows*) platform_dirs[windows]+="$dir " ;;
52-
*ubuntu*) platform_dirs[ubuntu]+="$dir " ;;
53-
*macos*) platform_dirs[macos]+="$dir " ;;
54-
esac
39+
for platform_dir in artifacts/*; do
40+
if [ -d "$platform_dir" ] && [ "$(find "$platform_dir" -type f | wc -l)" -gt 0 ]; then
41+
pkg_name=$(basename "$platform_dir")
42+
mkdir -p "GekkoNet-$pkg_name"
43+
cp -r "$platform_dir/"* "GekkoNet-$pkg_name/"
44+
tar -czf "GekkoNet-$pkg_name-Release.tar.gz" -C "GekkoNet-$pkg_name" .
5545
fi
5646
done
5747
58-
# create archives per platform
59-
for plat in "${!platform_dirs[@]}"; do
60-
dirs=${platform_dirs[$plat]}
61-
if [ -n "$dirs" ]; then
62-
mkdir -p "tmp-$plat"
63-
for d in $dirs; do
64-
cp -r "$d/"* "tmp-$plat/"
65-
done
66-
tar -czf "packages/GekkoNet-$plat-Release.tar.gz" -C "tmp-$plat" .
67-
rm -rf "tmp-$plat"
68-
fi
69-
done
70-
71-
echo "Created the following packages:"
72-
ls packages
73-
7448
- name: Release
7549
uses: softprops/action-gh-release@v2
7650
with:
7751
tag_name: ${{ env.TAG }}
78-
files: packages/*.tar.gz
52+
files: GekkoNet-*-Release.tar.gz
7953
env:
8054
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8155

@@ -84,15 +58,11 @@ jobs:
8458
runs-on: ubuntu-latest
8559
steps:
8660
- uses: actions/checkout@v4
87-
8861
- run: sudo apt-get update && sudo apt-get install -y doxygen graphviz
89-
9062
- run: |
9163
cmake -B build -DBUILD_DOCS=ON
9264
cmake --build build --target docs
93-
9465
- uses: actions/upload-pages-artifact@v3
9566
with:
9667
path: build/GekkoLib/docs/html
97-
9868
- uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)