diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..fd2faa8 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/mk b/mk index 2f4a2d9..e2946c3 100755 --- a/mk +++ b/mk @@ -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 "$@" diff --git a/mk.bat b/mk.bat index cdbbd06..6d09a8d 100644 --- a/mk.bat +++ b/mk.bat @@ -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 %*