Skip to content

Commit

Permalink
Set up basic publishing workflow
Browse files Browse the repository at this point in the history
Revamps the GitHub Actions workflows to the following:

**build.yml**
Verifies pull requests and commits to main.
Archives debug/release builds for them respectively.

**publish.yml**
On tag, downloads the relevant release build and publishes it as a GitHub Release.

Fixes #18
  • Loading branch information
Thierry Lacour committed Jul 15, 2021
1 parent 8cc4f2e commit 85608f5
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 32 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
platform: [ linux, windows, mac ]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

- name: Run GUT tests
uses: josephbmanley/[email protected]

- name: Decide debugMode
uses: haya14busa/action-cond@v1
id: debugMode
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: "true"
if_false: "false"

- name: Build game client
id: build
uses: josephbmanley/[email protected]
with:
name: NeoMori
preset: ${{ matrix.platform }}
debugMode: ${{ steps.debugMode.outputs.value }}

- name: Upload build
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}
path: ${{ github.workspace }}/build/*

- name: Git describe
run: echo "GIT_DESCRIBE=$(git describe)" >> $GITHUB_ENV

- name: Create override.cfg
if: ${{ env.GIT_DESCRIBE != '' }}
run: echo "global/version = $GIT_DESCRIBE" > override.cfg

- name: Upload override.cfg
if: ${{ env.GIT_DESCRIBE != '' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}
path: ${{ github.workspace }}/override.cfg
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest

strategy:
matrix:
platform: [ linux, windows, mac ]

steps:
- name: Download client
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
workflow_conclusion: success
commit: ${{ github.sha }}
event: push
name: ${{ matrix.platform }}
path: NeoMori

- name: Zip client
run: zip -q -r ${{ matrix.platform }}.zip NeoMori

- name: Publish clients
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.platform }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 0 additions & 32 deletions .github/workflows/verification.yml

This file was deleted.

0 comments on commit 85608f5

Please sign in to comment.