From ad909b8fc5563b99319f5315e40bb04cee32dc2f Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 6 May 2024 03:21:59 -0700 Subject: [PATCH] releasearc introduction. and split up workflow files --- .github/workflows/semantic-release.yml | 22 +++++++ .../workflows/{main.yml => test-runner.yml} | 62 +----------------- .github/workflows/unity-builder.yml | 63 +++++++++++++++++++ .releaserc.json | 45 +++++++++++++ 4 files changed, 132 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/semantic-release.yml rename .github/workflows/{main.yml => test-runner.yml} (50%) create mode 100644 .github/workflows/unity-builder.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml new file mode 100644 index 00000000..e868d55e --- /dev/null +++ b/.github/workflows/semantic-release.yml @@ -0,0 +1,22 @@ +name: Semantic Release +on: + push: + branches: + - master +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.4 + with: + fetch-depth: 0 + - name: Release + uses: cycjimmy/semantic-release-action@v4.1.0 + with: + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + branch: master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/test-runner.yml similarity index 50% rename from .github/workflows/main.yml rename to .github/workflows/test-runner.yml index 524a7c1a..b1aea8f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test-runner.yml @@ -1,4 +1,4 @@ -name: Main Build Actions +name: Test Runner on: [push, pull_request, workflow_dispatch] @@ -58,62 +58,4 @@ jobs: if: always() with: name: Test results for ${{ matrix.testMode }}-${{ matrix.unityVersion }} - path: ${{ steps.tests.outputs.artifactsPath }} - - #BUILD - builds: - name: ${{ matrix.targetPlatform }}-${{ matrix.unityVersion }} - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - targetPlatform: - - StandaloneWindows - #- WebGL - unityVersion: - - 2019.3.15f1 - - 2019.4.40f1 - - 2020.3.48f1 - - 2021.3.37f1 - - 2022.3.24f1 - - 2023.2.18f1 - - include: - - targetPlatform: WebGL - unityVersion: 2019.3.15f1 - - targetPlatform: WebGL - unityVersion: 2023.2.18f1 - - - steps: - #Build Checkout - - uses: actions/checkout@v4.1.4 - with: - fetch-depth: 0 - lfs: true - - #Build Cache - - uses: actions/cache@v4.0.2 - with: - path: Library - key: Library-${{ matrix.unityVersion }} - restore-keys: - Library-${{ matrix.unityVersion }} - - #Build - - uses: game-ci/unity-builder@v4.2.3 - env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - with: - targetPlatform: ${{ matrix.targetPlatform }} - unityVersion: ${{ matrix.unityVersion }} - customParameters: '-nographics' - - #Build Artifact - - uses: actions/upload-artifact@v4.3.3 - with: - name: Build-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }} - path: build/${{ matrix.targetPlatform }} + path: ${{ steps.tests.outputs.artifactsPath }} \ No newline at end of file diff --git a/.github/workflows/unity-builder.yml b/.github/workflows/unity-builder.yml new file mode 100644 index 00000000..a78f9c1c --- /dev/null +++ b/.github/workflows/unity-builder.yml @@ -0,0 +1,63 @@ +name: Unity Builder + +on: [push, pull_request, workflow_dispatch] + +jobs: + + #BUILD + builds: + name: Build-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }} + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + targetPlatform: + - StandaloneWindows + #- WebGL + unityVersion: + - 2019.3.15f1 + - 2019.4.40f1 + - 2020.3.48f1 + - 2021.3.37f1 + - 2022.3.24f1 + - 2023.2.18f1 + + include: + - targetPlatform: WebGL + unityVersion: 2019.3.15f1 + - targetPlatform: WebGL + unityVersion: 2023.2.18f1 + + + steps: + #Build Checkout + - uses: actions/checkout@v4.1.4 + with: + fetch-depth: 0 + lfs: true + + #Build Cache + - uses: actions/cache@v4.0.2 + with: + path: Library + key: Library-${{ matrix.unityVersion }} + restore-keys: + Library-${{ matrix.unityVersion }} + + #Build + - uses: game-ci/unity-builder@v4.2.3 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + targetPlatform: ${{ matrix.targetPlatform }} + unityVersion: ${{ matrix.unityVersion }} + customParameters: '-nographics' + + #Build Artifact + - uses: actions/upload-artifact@v4.3.3 + with: + name: Build-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }} + path: build/${{ matrix.targetPlatform }} \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 00000000..2d2005f9 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,45 @@ +{ + "tagFormat": "${version}", + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "releaseRules": [ + { "type": "docs", "scope": "README", "release": "patch" }, + { "type": "refactor", "release": "patch" }, + { "type": "style", "release": "patch" } + ], + "parserOpts": { + "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"] + } + } + ], + + "@semantic-release/release-notes-generator", + + [ + "@semantic-release/changelog", + { + "preset": "angular" + } + ], + + [ + "@semantic-release/npm", + { + "npmPublish": false + } + ], + + [ + "@semantic-release/git", + { + "assets": ["package.json", "CHANGELOG.md"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + + "@semantic-release/github" + ] +}