Skip to content

Commit

Permalink
feat: github action
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Oct 9, 2023
1 parent 7484568 commit fe03f9e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:

jobs:
build:
strategy:
matrix:
os: [ubuntu, windows, macos]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- name: Build (GCC)
if: matrix.os != 'windows'
run: ./mk
- uses: ilammy/msvc-dev-cmd@v1
- name: Build (Windows)
if: matrix.os == 'windows'
shell: cmd
run: mk.bat
- uses: actions/upload-artifact@v3
with:
name: binary-${{ matrix.os }}
retention-days: 1
path: |
fart
fart.exe
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
fart
fart.exe
fail_on_unmatched_files: false
generate_release_notes: true
append_body: true
2 changes: 1 addition & 1 deletion mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
if [ "$CC" == "" ]; then CC=gcc ; fi
if [ "$CC" = "" ]; then CC=gcc ; fi
$CC fart.cpp fart_shared.c wildmat.c -o fart "$@"
3 changes: 2 additions & 1 deletion mk.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REM /O1 /GR- /GX-
cl fart.cpp fart_shared.c wildmat.c %*
if "%CC%"=="" set CC=cl
%CC% fart.cpp fart_shared.c wildmat.c %*

0 comments on commit fe03f9e

Please sign in to comment.