Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,41 @@ jobs:
path: build/cpp-repl
retention-days: 7

release:
name: Automatic Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: cpp-repl-ubuntu-24.04-llvm22
path: ./artifact

- name: Prepare release archive
run: |
ls -lh ./artifact/cpp-repl
chmod +x ./artifact/cpp-repl
tar czf cpp-repl-auto-${{ github.sha }}-linux-x86_64.tar.gz -C ./artifact cpp-repl
sha256sum cpp-repl-auto-${{ github.sha }}-linux-x86_64.tar.gz | tee SHA256SUMS
cat SHA256SUMS

- name: Create Automatic GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: auto-${{ github.sha }}
name: Automatic Release ${{ github.sha }}
target_commitish: ${{ github.sha }}
files: |
cpp-repl-*.tar.gz
SHA256SUMS
generate_release_notes: true
fail_on_unmatched_files: false

# Fast sanity job for PRs without full LLVM install (doc/lint only) could be added here
22 changes: 16 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Release

on:
push:
branches:
- main
tags:
- 'v*.*.*'
workflow_dispatch:
Expand Down Expand Up @@ -35,24 +37,32 @@ jobs:
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-22 -DCMAKE_CXX_COMPILER=clang++-22 -DLLVM_DIR=/usr/lib/llvm-22/lib/cmake/llvm
cmake --build build -j $(nproc)
./build/cpp-repl --version
tar czf cpp-repl-${{ github.ref_name }}-linux-x86_64.tar.gz -C build cpp-repl
sha256sum cpp-repl-${{ github.ref_name }}-linux-x86_64.tar.gz | tee SHA256SUMS
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
else
TAG="auto-${{ github.sha }}"
fi
echo "TAG=$TAG" >> $GITHUB_ENV
tar czf cpp-repl-${TAG}-linux-x86_64.tar.gz -C build cpp-repl
sha256sum cpp-repl-${TAG}-linux-x86_64.tar.gz | tee SHA256SUMS

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG }}
name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('Automatic Release {0}', github.sha) }}
target_commitish: ${{ github.sha }}
files: |
cpp-repl-*.tar.gz
SHA256SUMS
generate_release_notes: true
fail_on_unmatched_files: false

- name: Upload artifact (manual dispatch)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload artifact (manual dispatch fallback)
if: failure()
uses: actions/upload-artifact@v4
with:
name: cpp-repl-release-${{ github.ref_name || inputs.tag || 'manual' }}
name: cpp-repl-release-${{ env.TAG || github.ref_name || inputs.tag || 'manual' }}
path: |
cpp-repl-*.tar.gz
SHA256SUMS
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ compile_commands.json
.DS_Store
.cache/
ccache/
Testing/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ add_executable(cpp-repl
src/interpreter/interpreter.cpp
src/utils/version_detector.cpp
src/utils/bigint.cpp
src/utils/highlight.cpp
src/repl/session.cpp
src/cli/cli.cpp
)
Expand Down
Loading
Loading