From d72b26e0eb39043c4b5415b072e4c7a82399a90e Mon Sep 17 00:00:00 2001 From: Vipul-Cariappa Date: Wed, 3 Jan 2024 16:07:18 +0530 Subject: [PATCH] ci fix --- .github/workflows/build_and_test.yml | 36 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 8 +++---- 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build_and_test.yml diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 0000000..8250c4f --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,36 @@ +name: Build and Test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get upgrade -y + sudo apt-get install -y gcc-mingw-w64 cmake make gcc bison flex + + - name: Build for Linux + run: | + cmake -DCMAKE_BUILD_TYPE=Debug . + make + mv ./KariLang ./KariLang-Linux-x86-64 + + - name: Build for Windows + run: | + x86_64-w64-mingw32-gcc -Wall -g \ + ./src/main.c \ + ./src/semantics.c \ + ./src/interpreter.c \ + ./src/lex.yy.c \ + ./src/parser.tab.c \ + -o ./KariLang-Windows-x86-64.exe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95a5799..f5c26da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,9 @@ -name: Build +name: Release on: push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + tags: + - "v*.*.*" jobs: build: @@ -37,7 +36,6 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') with: files: | KariLang-Windows-x86-64.exe