Skip to content

Commit ca3cf34

Browse files
build: adding workflows for node linux builds and script to bundle them in a way usable for our internal systems
1 parent ebdee46 commit ca3cf34

File tree

4 files changed

+72
-120
lines changed

4 files changed

+72
-120
lines changed

.github/workflows/build-node-fibers.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ on:
66
workflows: [Build Node]
77
types:
88
- completed
9-
#pull_request:
10-
#paths: .github/workflows/build-node-fibers.yml
11-
#push:
12-
#branches:
13-
#- v20.18.3
14-
#- workflows-for-v20.18.3
159

1610
jobs:
1711
build-fibers:

stage_for_s3.bash

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
3+
mkdir stage
4+
cd stage || exit
5+
6+
TIMESTAMP=$(date '+%Y%m%d.%H%M')
7+
8+
echo "Current timestamp is $TIMESTAMP"
9+
10+
gh release download -p "*.gz"
11+
gh release download -p "*.xz"
12+
13+
curl "https://asana-oss-cache.s3.us-east-1.amazonaws.com/node-fibers/fibers-5.0.4.pc.tgz" --output fibers-5.0.4.tar.gz
14+
tar -xzf fibers-5.0.4.tar.gz
15+
16+
find . -name "*.gz" | while read -r a
17+
do
18+
tar -xzf "$a" -C package/bin
19+
rm "$a"
20+
done
21+
22+
tar -czf temp.tgz package/
23+
rm -fr package
24+
SHORT_HASH=$(cat temp.tgz | sha1sum | cut -c1-4)
25+
echo "HASH: $SHORT_HASH"
26+
UNIQUE="pc-${TIMESTAMP}-${SHORT_HASH}"
27+
28+
mv temp.tgz "fibers-5.0.4-${UNIQUE}.tgz"
29+
30+
for file in *.tar.xz; do
31+
if [[ "$file" == *-LATEST.tar.xz ]]; then
32+
base="${file%-LATEST.tar.xz}"
33+
new_name="${base}-${UNIQUE}.tar.xz"
34+
35+
echo "Renaming: $file -> $new_name"
36+
mv "$file" "$new_name"
37+
38+
if [[ "$new_name" =~ node-v([0-9.]+)-(darwin|linux)-(arm64|x64)-pc.*\.tar\.xz$ ]]; then
39+
version="${BASH_REMATCH[1]}"
40+
os="${BASH_REMATCH[2]}"
41+
arch="${BASH_REMATCH[3]}"
42+
target_dir="node-v${version}-${os}-${arch}"
43+
44+
echo "Target Dir: $target_dir"
45+
mkdir "$target_dir"
46+
tar -xzf "$new_name" -C "$target_dir"
47+
mv "$target_dir/usr/local/*" "$target_dir"
48+
rm -fr "$target_dir/usr/local"
49+
50+
tar -cJf "$new_name" "$target_dir"
51+
52+
rm -fr "$target_dir"
53+
54+
echo "✅ Done: Archive now contains:"
55+
tar -tf "$new_name" | head
56+
57+
else
58+
echo "Warning: Skipped $new_name due to unexpected filename format."
59+
fi
60+
fi
61+
done
62+
63+
64+
cd ..
65+
mv stage "node-${UNIQUE}"
66+
67+
echo "Files are in node-${UNIQUE}, please upload to s3"
68+
69+
70+

stage_for_s3.sh

Lines changed: 0 additions & 113 deletions
This file was deleted.

tools/dep_updaters/update-openssl.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ main() {
174174
* )
175175
echo "unknown command: $1"
176176
help 1
177-
exit 1
177+
# shellcheck disable=SC2317
178+
exit 1
178179
;;
179180
esac
180181
}

0 commit comments

Comments
 (0)