Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
malloc-nbytes authored Jan 9, 2025
1 parent 6df8c1a commit 2722d2a
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Release EARL

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Set up CMake
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake make tar

# Run build commands
- name: Build EARL
run: |
mkdir -p build
cd build
cmake -S .. -B . -DPORTABLE=ON
make
VERSION=$(grep 'version' ../CMakeLists.txt | head -n 1 | cut -d '"' -f 2) #
tar -czvf EARL-${VERSION}-linux.tar.gz -C build .
# Upload to GitHub Releases
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
body: Automated release of EARL
draft: false
prerelease: false
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/EARL-${VERSION}-linux.tar.gz
asset_name: EARL-${VERSION}-linux.tar.gz
asset_content_type: application/gzip

0 comments on commit 2722d2a

Please sign in to comment.