Skip to content

Commit

Permalink
move workflow artifact job to template
Browse files Browse the repository at this point in the history
  • Loading branch information
h0tw1r3 committed Apr 7, 2024
1 parent 6d49f46 commit 89eba8f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/build.yml → .github/workflows/_artifact.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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 .
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Release"

on:
push:
branches: [ 'main', 'master' ]
workflow_dispatch:

jobs:
Artifacts:
uses: ./.github/workflows/_artifact.yml
with:
opt: "-O3"

0 comments on commit 89eba8f

Please sign in to comment.