Skip to content

Commit

Permalink
release first try
Browse files Browse the repository at this point in the history
  • Loading branch information
arijitsh committed Jan 23, 2025
1 parent cf5ad33 commit 7aa9a2c
Showing 1 changed file with 61 additions and 13 deletions.
74 changes: 61 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
on: [push, pull_request]
name: CI
on:
push:
branches:
- main
- release
pull_request:

name: CI and Release

jobs:
build:
Expand All @@ -12,14 +18,15 @@ jobs:
- name: clang
env: CC=clang CXX=clang++

name: ${{ matrix.name }}
runs-on: [ubuntu-latest]
name: Build with ${{ matrix.name }}
runs-on: ubuntu-latest

steps:

# Checkout repository
- uses: actions/checkout@v2

- name: Packages
# Install dependencies
- name: Install Packages
run: |
sudo apt-get update
sudo apt-get install -y \
Expand All @@ -39,26 +46,67 @@ jobs:
zlib1g-dev
sudo pip3 install -U lit
- name: Dependencies
# Set up dependencies
- name: Set Up Dependencies
run: |
./scripts/deps/setup-minisat.sh
./scripts/deps/setup-cms.sh
./scripts/deps/setup-gtest.sh
./scripts/deps/setup-unisamp.sh
./scripts/deps/setup-outputcheck.sh
# Configure with static linking enabled
- name: Configure
run: |
mkdir build
cd build
${{ matrix.env }} cmake -DNOCRYPTOMINISAT:BOOL=OFF -DENABLE_TESTING:BOOL=ON -DPYTHON_EXECUTABLE:PATH="$(which python3)" -G Ninja ..
${{ matrix.env }} cmake -DNOCRYPTOMINISAT:BOOL=OFF -DENABLE_TESTING:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DPYTHON_EXECUTABLE:PATH="$(which python3)" -G Ninja ..
# Build the static binary
- name: Build
run: cmake --build . --parallel "$(nproc)"
run: cmake --build . --target csb --parallel "$(nproc)"
working-directory: build

# - name: Test
# run: ctest --parallel "$(nproc)" -VV --output-on-failure
# working-directory: build
# Upload the binary as a build artifact
- name: Upload Binary Artifact
uses: actions/upload-artifact@v3
with:
name: static-binary-${{ matrix.name }}
path: build/csb

release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/release' && github.event_name == 'push'

steps:
# Checkout repository
- uses: actions/checkout@v2

# Download the binary artifacts
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: static-binary-${{ matrix.name }}
path: build/

# Create a release and upload binaries
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: "Release v${{ github.run_number }}"
draft: false
prerelease: false

# EOF
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/csb
asset_name: csb-${{ matrix.name }}
asset_content_type: application/octet-stream

0 comments on commit 7aa9a2c

Please sign in to comment.