-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14ce493
commit 408dbd6
Showing
1 changed file
with
23 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |