Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-arash authored Aug 24, 2024
1 parent 14ce493 commit 408dbd6
Showing 1 changed file with 23 additions and 36 deletions.
59 changes: 23 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,31 @@
name: Build and Release
name: Build Extreme Math for Windows

on:
push:
tags:
- 'v*.*.*' # Trigger the workflow only on tag pushes, e.g., v1.0.0
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest # Use Ubuntu for the build environment

runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up C++ environment
uses: actions/setup-cpp@v3
with:
cpp-version: '11' # Set the desired C++ version

- name: Install dependencies
run: sudo apt-get install -y build-essential # Install necessary build tools

- name: Build project
run: make # Compile the project using the Makefile

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }} # Use the tag name for the release
release_name: 'Release ${{ github.ref }}'
draft: false
prerelease: false

- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/extreme_math # Path to the built executable
asset_name: extreme_math.exe
asset_content_type: application/octet-stream
- name: Checkout code
uses: actions/checkout@v3

- name: Set up MinGW for Windows
run: |
choco install mingw
- name: Compile with g++
run: |
g++ -o extreme_math.exe src/*.cpp
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: extreme-math-windows
path: |
extreme_math.exe

0 comments on commit 408dbd6

Please sign in to comment.