Skip to content

Commit 7f3c4e8

Browse files
committed
upload nitghtly releases
1 parent f698ae9 commit 7f3c4e8

File tree

1 file changed

+156
-53
lines changed

1 file changed

+156
-53
lines changed

.github/workflows/release.yml

Lines changed: 156 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
version: ${{ steps.version.outputs.version }}
4444
prerelease: ${{ steps.version.outputs.prerelease }}
4545
is_nightly: ${{ steps.version.outputs.is_nightly }}
46+
upload_url: ${{ steps.create_release.outputs.upload_url }}
4647

4748
steps:
4849
- name: Checkout code
@@ -74,16 +75,25 @@ jobs:
7475
7576
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
7677
# Manual release
77-
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
78+
VERSION="${{ github.event.inputs.version }}"
79+
echo "version=$VERSION" >> $GITHUB_OUTPUT
7880
echo "prerelease=${{ github.event.inputs.prerelease }}" >> $GITHUB_OUTPUT
7981
echo "is_nightly=false" >> $GITHUB_OUTPUT
8082
83+
echo "🚀 Creating manual release: $VERSION"
84+
8185
else
8286
# Tag-based release
83-
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
87+
VERSION="${GITHUB_REF#refs/tags/}"
88+
echo "version=$VERSION" >> $GITHUB_OUTPUT
8489
echo "prerelease=false" >> $GITHUB_OUTPUT
8590
echo "is_nightly=false" >> $GITHUB_OUTPUT
91+
92+
echo "🏷️ Creating tag-based release: $VERSION"
8693
fi
94+
95+
# Debug output
96+
echo "Final version: $VERSION"
8797
8898
- name: Cleanup old nightly releases
8999
if: steps.version.outputs.is_nightly == 'true'
@@ -236,7 +246,7 @@ jobs:
236246
--notes-file CHANGELOG.md
237247
fi
238248
239-
echo "✅ Release created successfully"
249+
echo "✅ Release created successfully: $VERSION"
240250
env:
241251
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
242252

@@ -275,29 +285,93 @@ jobs:
275285
case "${{ runner.os }}" in
276286
Linux)
277287
sudo apt-get update -qq
288+
# Install C++ build tools with proper standard library
278289
sudo apt-get install -y \
279290
build-essential \
280291
cmake \
292+
ninja-build \
281293
libboost-all-dev \
282294
libssl-dev \
283295
pkg-config \
284-
git
296+
git \
297+
libc++-dev \
298+
libc++abi-dev
299+
285300
echo "✅ Linux dependencies installed"
301+
302+
# Set CMake to use system default C++ stdlib instead of forcing libc++
303+
echo "CMAKE_CXX_FLAGS=-stdlib=libstdc++" >> $GITHUB_ENV
304+
echo "CC=gcc" >> $GITHUB_ENV
305+
echo "CXX=g++" >> $GITHUB_ENV
286306
;;
287307
macOS)
288308
brew update
289-
brew install boost openssl cmake
309+
brew install boost openssl cmake ninja
290310
echo "✅ macOS dependencies installed"
311+
312+
# Use default Clang on macOS (which has proper libc++ support)
313+
echo "CC=clang" >> $GITHUB_ENV
314+
echo "CXX=clang++" >> $GITHUB_ENV
291315
;;
292316
esac
293317
294-
- name: Cache Zig artifacts
318+
- name: Cache build dependencies
295319
uses: actions/cache@v4
296320
with:
297321
path: |
298322
~/.cache/zig
299323
.zig-cache
300-
key: ${{ runner.os }}-zig-${{ env.ZIG_VERSION }}-release-${{ hashFiles('build.zig', 'build.zig.zon') }}
324+
vendor/solidity/build
325+
key: ${{ runner.os }}-${{ matrix.target }}-deps-${{ hashFiles('build.zig', 'build.zig.zon') }}
326+
restore-keys: |
327+
${{ runner.os }}-${{ matrix.target }}-deps-
328+
${{ runner.os }}-deps-
329+
330+
- name: Configure Solidity build
331+
run: |
332+
echo "🔧 Configuring Solidity build..."
333+
cd vendor/solidity
334+
335+
case "${{ runner.os }}" in
336+
Linux)
337+
# Use system default compiler and standard library
338+
cmake -S . -B build \
339+
-DCMAKE_BUILD_TYPE=Release \
340+
-DCMAKE_CXX_COMPILER=g++ \
341+
-DCMAKE_C_COMPILER=gcc \
342+
-DCMAKE_CXX_STANDARD=20 \
343+
-DUSE_CVC4=OFF \
344+
-DUSE_Z3=OFF \
345+
-DTESTS=OFF \
346+
-DSTRICT=OFF \
347+
-DSOLC_LINK_STATIC=ON \
348+
-GNinja
349+
;;
350+
macOS)
351+
# Use Clang with proper macOS settings
352+
cmake -S . -B build \
353+
-DCMAKE_BUILD_TYPE=Release \
354+
-DCMAKE_CXX_COMPILER=clang++ \
355+
-DCMAKE_C_COMPILER=clang \
356+
-DCMAKE_CXX_STANDARD=20 \
357+
-DUSE_CVC4=OFF \
358+
-DUSE_Z3=OFF \
359+
-DTESTS=OFF \
360+
-DSTRICT=OFF \
361+
-DSOLC_LINK_STATIC=ON \
362+
-GNinja
363+
;;
364+
esac
365+
366+
- name: Build Solidity libraries
367+
run: |
368+
echo "🔨 Building Solidity libraries..."
369+
cd vendor/solidity/build
370+
371+
# Build only the libraries we need
372+
ninja -j$(nproc) solutil langutil smtutil evmasm yul
373+
374+
echo "✅ Solidity libraries built successfully"
301375
302376
- name: Build release binary
303377
run: |
@@ -310,8 +384,13 @@ jobs:
310384
if [ -f "zig-out/bin/ora" ]; then
311385
echo "✅ Binary built successfully"
312386
ls -la zig-out/bin/
387+
388+
# Show binary info
389+
file zig-out/bin/ora
390+
du -h zig-out/bin/ora
313391
else
314392
echo "❌ Binary not found"
393+
ls -la zig-out/
315394
exit 1
316395
fi
317396
@@ -322,9 +401,22 @@ jobs:
322401
if [ -f "zig-out/bin/ora" ]; then
323402
# Test basic functionality
324403
chmod +x zig-out/bin/ora
325-
./zig-out/bin/ora --version 2>/dev/null || echo "⚠️ Version check failed"
326-
./zig-out/bin/ora --help 2>/dev/null || echo "⚠️ Help check failed"
404+
405+
echo "Testing --version..."
406+
./zig-out/bin/ora --version 2>/dev/null || echo "⚠️ Version check failed (expected for now)"
407+
408+
echo "Testing --help..."
409+
./zig-out/bin/ora --help 2>/dev/null || echo "⚠️ Help check failed (expected for now)"
410+
411+
echo "Testing compilation..."
412+
echo 'contract Test { pub fn init() {} }' > test.ora
413+
./zig-out/bin/ora compile test.ora 2>/dev/null || echo "⚠️ Compilation test failed"
414+
rm -f test.ora
415+
327416
echo "✅ Binary test completed"
417+
else
418+
echo "❌ No binary to test"
419+
exit 1
328420
fi
329421
330422
- name: Create binary package
@@ -339,74 +431,79 @@ jobs:
339431
340432
# Add documentation
341433
cp LICENSE release-package/ 2>/dev/null || echo "LICENSE not found"
434+
cp README.md release-package/ 2>/dev/null || echo "README not found"
342435
343436
# Create simple README for the package
344-
cat > release-package/README.txt << EOF
345-
Ora Compiler - ${{ matrix.platform }}
346-
================================
347-
348-
This is the Ora compiler binary for ${{ matrix.platform }}.
349-
350-
Usage:
351-
./ora-${{ matrix.platform }} [options] <file.ora>
352-
353-
Options:
354-
--help Show help information
355-
--version Show version information
356-
357-
For more information, visit:
358-
https://github.com/${{ github.repository }}
359-
EOF
437+
{
438+
echo "Ora Compiler - ${{ matrix.platform }}"
439+
echo "================================"
440+
echo ""
441+
echo "This is the Ora compiler binary for ${{ matrix.platform }}."
442+
echo ""
443+
echo "Usage:"
444+
echo " ./ora-${{ matrix.platform }} [options] <file.ora>"
445+
echo ""
446+
echo "Options:"
447+
echo " --help Show help information"
448+
echo " --version Show version information"
449+
echo ""
450+
echo "For more information, visit:"
451+
echo "https://github.com/${{ github.repository }}"
452+
} > release-package/README.txt
360453
361454
ls -la release-package/
455+
echo "Package contents:"
456+
du -sh release-package/*
362457
363458
- name: Generate checksums
364459
run: |
365460
echo "🔍 Generating checksums..."
366461
cd release-package
367462
368-
shasum -a 256 "ora-${{ matrix.platform }}" > checksums.txt
463+
# Generate SHA256 checksums
464+
shasum -a 256 "ora-${{ matrix.platform }}" > "checksums-${{ matrix.platform }}.txt"
369465
370-
echo "📋 Checksums:"
371-
cat checksums.txt
466+
echo "📋 Checksums for ${{ matrix.platform }}:"
467+
cat "checksums-${{ matrix.platform }}.txt"
372468
373469
- name: Upload binary to release
374470
run: |
375471
echo "📤 Uploading binary to release..."
376472
377-
# Get version from tag or input
378-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
379-
version="${{ github.event.inputs.version }}"
473+
VERSION="${{ needs.create-release.outputs.version }}"
474+
echo "Using version: $VERSION"
475+
476+
# Check if release exists
477+
if gh release view "$VERSION" >/dev/null 2>&1; then
478+
echo "✅ Release $VERSION found"
479+
480+
# Upload binary
481+
gh release upload "$VERSION" \
482+
"release-package/ora-${{ matrix.platform }}" \
483+
--clobber
484+
485+
echo "✅ Binary uploaded successfully"
380486
else
381-
version="${GITHUB_REF#refs/tags/}"
487+
echo "❌ Release $VERSION not found"
488+
echo "Available releases:"
489+
gh release list --limit 10
490+
exit 1
382491
fi
383-
384-
# Upload binary
385-
gh release upload "$version" \
386-
"release-package/ora-${{ matrix.platform }}" \
387-
--clobber
388-
389-
echo "✅ Binary uploaded"
390492
env:
391493
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
392494

393495
- name: Upload checksums to release
394496
run: |
395497
echo "📤 Uploading checksums to release..."
396498
397-
# Get version from tag or input
398-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
399-
version="${{ github.event.inputs.version }}"
400-
else
401-
version="${GITHUB_REF#refs/tags/}"
402-
fi
499+
VERSION="${{ needs.create-release.outputs.version }}"
403500
404501
# Upload checksums
405-
gh release upload "$version" \
406-
"release-package/checksums.txt#checksums-${{ matrix.platform }}.txt" \
502+
gh release upload "$VERSION" \
503+
"release-package/checksums-${{ matrix.platform }}.txt" \
407504
--clobber
408505
409-
echo "✅ Checksums uploaded"
506+
echo "✅ Checksums uploaded successfully"
410507
env:
411508
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
412509

@@ -427,7 +524,7 @@ jobs:
427524
- name: Checkout code
428525
uses: actions/checkout@v4
429526

430-
- name: Update release summary
527+
- name: Post-release summary
431528
run: |
432529
VERSION="${{ needs.create-release.outputs.version }}"
433530
IS_NIGHTLY="${{ needs.create-release.outputs.is_nightly }}"
@@ -441,9 +538,15 @@ jobs:
441538
echo "📦 Release: $VERSION"
442539
fi
443540
444-
echo "🔗 URL: https://github.com/${{ github.repository }}/releases/tag/$VERSION"
541+
echo "🔗 Release URL: https://github.com/${{ github.repository }}/releases/tag/$VERSION"
445542
echo ""
446-
echo "📊 Post-release tasks completed"
543+
echo "📊 Pipeline Summary:"
544+
echo "✅ Release created: $VERSION"
447545
echo "✅ Binaries built for all platforms"
448-
echo "✅ Checksums generated"
449-
echo "✅ Release assets uploaded"
546+
echo "✅ Checksums generated and uploaded"
547+
echo "✅ Release assets uploaded"
548+
549+
echo "🎯 Next steps:"
550+
echo "- Test the release binaries"
551+
echo "- Update documentation if needed"
552+
echo "- Announce the release"

0 commit comments

Comments
 (0)