Skip to content

Commit

Permalink
Add a CI/CD and a Release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertzui123 committed Jul 7, 2024
1 parent 2b2d18d commit a163d08
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI/CD

on:
- push

jobs:
build-linux:
runs-on: ubuntu-latest

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

- name: Install graphics libraries
run: sudo apt-get install --quiet -y libglfw3-dev libxi-dev libxcursor-dev

- name: Install ASPL
uses: aspl-lang/setup-aspl@v1

- name: Build Libellus
run: aspl -cc gcc -backend c compile .
51 changes: 51 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Release

on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
required: true

jobs:
build-and-release:
runs-on: ubuntu-latest

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

- name: Install graphics libraries
run: sudo apt-get install --quiet -y libglfw3-dev libxi-dev libxcursor-dev

- name: Install ASPL
uses: aspl-lang/setup-aspl@v1

- name: Build Libellus
run: aspl -cc gcc -backend c -prod compile .

- name: Archive built executable
run: |
mkdir -p bin
mv Libellus bin/Libellus-${{ github.event.inputs.release_version }}-linux
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.release_version }}
release_name: ${{ github.event.inputs.release_version }}
draft: false
prerelease: false

- 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: bin/Libellus-${{ github.event.inputs.release_version }}-linux
asset_name: Libellus-${{ github.event.inputs.release_version }}-linux
asset_content_type: application/octet-stream

0 comments on commit a163d08

Please sign in to comment.