From bd14c86eec75ea99563cb341ea2e7851c197e5a8 Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Sun, 7 Apr 2024 16:10:26 -0500 Subject: [PATCH] move workflow artifact job to template --- .../workflows/{build.yml => _artifact.yml} | 30 +++++++------------ .github/workflows/ci.yml | 21 +++++++++++++ .github/workflows/release.yml | 13 ++++++++ 3 files changed, 45 insertions(+), 19 deletions(-) rename .github/workflows/{build.yml => _artifact.yml} (89%) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/_artifact.yml similarity index 89% rename from .github/workflows/build.yml rename to .github/workflows/_artifact.yml index 7d08dc75..3ad4cb9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/_artifact.yml @@ -1,25 +1,16 @@ -name: Build +--- +name: _artifact on: - workflow_dispatch: + workflow_call: inputs: opt: - description: "OPT value" - default: "-O3 -g" - pull_request: - paths-ignore: - - '**.md' - - 'Assets/**' - - 'Config/**' - - 'Docs/**' - push: - branches: - - master - - dev - - main + description: "make OPT value" + type: string + default: "-O3" jobs: - build: + Build: strategy: fail-fast: true matrix: @@ -85,16 +76,17 @@ jobs: install: >- make zip + git mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net - - name: Build + - name: Compile run: | - OPT_INPUT="${{ github.event.inputs.opt }}" + OPT_INPUT="${{ inputs.opt }}" make -f Makefiles/${{ matrix.makefile }} release NET_BOARD=1 OUTFILE=../supermodel${{ matrix.outfile_ext }} OPT="${OPT_INPUT:-"-O3 -g"}" LDOPT="" SDL_FRAMEWORK_RELEASE=${{ steps.find_sdl.outputs.name }} SDL_NET_FRAMEWORK_RELEASE=${{ steps.find_sdl_net.outputs.name }} - name: Validate run: ./supermodel${{ matrix.outfile_ext }} -print-games - - name: Package + - name: Archive run: | mkdir NVRAM Saves ROMs cp Docs/LICENSE.txt Docs/README.txt . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..56783df9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +--- +name: "CI" + +on: + pull_request: + branches: [ 'main', 'master' ] + paths-ignore: + - '**.md' + - 'Assets/**' + - 'Config/**' + - 'Docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Artifacts: + uses: ./.github/workflows/_artifact.yml + with: + opt: "-O3 -g" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..b3f46687 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,13 @@ +--- +name: "Release" + +on: + push: + branches: [ 'main', 'master' ] + workflow_dispatch: + +jobs: + Artifacts: + uses: ./.github/workflows/_artifact.yml + with: + opt: "-O3"