diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e60d0c8 --- /dev/null +++ b/.github/workflows/build.yml @@ -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/run-gut-tests-action@v1.1.0 + + - 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/build-godot-action@v1.4.1 + 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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4cbb636 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/.github/workflows/verification.yml b/.github/workflows/verification.yml deleted file mode 100644 index 8f3ba61..0000000 --- a/.github/workflows/verification.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Verification - -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: - lfs: true - - name: Build - id: build - uses: josephbmanley/build-godot-action@v1.4.1 - with: - name: example - preset: ${{ matrix.platform }} - debugMode: "true" - - uses: josephbmanley/run-gut-tests-action@v1.0.1 - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: Client - ${{ matrix.platform }} - path: ${{ github.workspace }}/${{ steps.build.outputs.build }}