Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions .github/workflows/build-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- "master"
tags:
- "!*" # not a tag push
pull_request:
branches:
- "master"
Expand All @@ -26,11 +24,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Execute scripts: RuntimeUnitTestToolkit(Linux64/Mono2x)
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
- name: Build UnitTest(Linux64, mono)
uses: game-ci/unity-builder@v2.0-alpha-6
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets[matrix.license] }}
with:
Expand All @@ -46,7 +44,7 @@ jobs:
# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Export unitypackage
uses: game-ci/unity-builder@v2.0-alpha-6
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets[matrix.license] }}
with:
Expand All @@ -56,12 +54,6 @@ jobs:
buildMethod: PackageExporter.Export
versioning: None

- name: check all .meta is commited
run: |
if git ls-files --others --exclude-standard -t | grep --regexp='[.]meta$'; then
echo "Detected .meta file generated. Do you forgot commit a .meta file?"
exit 1
else
echo "Great, all .meta files are commited."
fi
working-directory: RuntimeUnitTestToolkit
- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
with:
directory: RuntimeUnitTestToolkit
102 changes: 22 additions & 80 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,23 @@ on:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
dry_run:
description: "dry_run: true will never create relase/nuget."
dry-run:
description: "dry-run: true will never create relase/nuget."
required: true
default: "false"
default: false
type: boolean

env:
GIT_TAG: ${{ github.event.inputs.tag }}
DRY_RUN: ${{ github.event.inputs.dry_run }}
DRY_RUN_BRANCH_PREFIX: "test_release"
DRY_RUN: ${{ github.event.inputs.dry-run }}

jobs:
update-packagejson:
runs-on: ubuntu-latest
env:
TARGET_FILE: ./RuntimeUnitTestToolkit/Assets/RuntimeUnitTestToolkit/package.json
outputs:
sha: ${{ steps.commit.outputs.sha }}
steps:
- uses: actions/checkout@v2
- name: Output package.json (Before)
run: cat ${{ env.TARGET_FILE}}

- name: Update package.json to version ${{ env.GIT_TAG }}
run: sed -i -e "s/\(\"version\":\) \"\(.*\)\",/\1 \"${{ env.GIT_TAG }}\",/" ${{ env.TARGET_FILE }}

- name: Check update
id: check_update
run: |
cat ${{ env.TARGET_FILE}}
git diff --exit-code || echo "::set-output name=changed::1"

- name: Commit files
id: commit
if: steps.check_update.outputs.changed == '1'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "feat: Update package.json to ${{ env.GIT_TAG }}" -a
echo "::set-output name=sha::$(git rev-parse HEAD)"

- name: Check sha
run: echo "SHA ${SHA}"
env:
SHA: ${{ steps.commit.outputs.sha }}

- name: Create Tag
if: steps.check_update.outputs.changed == '1'
run: git tag ${{ env.GIT_TAG }}

- name: Push changes
if: env.DRY_RUN == 'false' && steps.check_update.outputs.changed == '1'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true

- name: Push changes (dry_run)
if: env.DRY_RUN == 'true' && steps.check_update.outputs.changed == '1'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.DRY_RUN_BRANCH_PREFIX }}-${{ env.GIT_TAG }}
tags: false
uses: Cysharp/Actions/.github/workflows/update-packagejson.yaml@main
with:
file-path: ./RuntimeUnitTestToolkit/Assets/RuntimeUnitTestToolkit/package.json
tag: ${{ github.event.inputs.tag }}
dry-run: ${{ fromJson(github.event.inputs.dry-run) }}

build-unity:
needs: [update-packagejson]
Expand All @@ -82,13 +35,13 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ needs.update-packagejson.outputs.sha }}
# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Export unitypackage
uses: game-ci/unity-builder@v2.0-alpha-6
uses: game-ci/unity-builder@v2
env:
UNITY_PACKAGE_VERSION: ${{ env.GIT_TAG }}
UNITY_LICENSE: ${{ secrets[matrix.license] }}
Expand All @@ -99,15 +52,9 @@ jobs:
buildMethod: PackageExporter.Export
versioning: None

- name: check all .meta is commited
run: |
if git ls-files --others --exclude-standard -t | grep --regexp='[.]meta$'; then
echo "Detected .meta file generated. Do you forgot commit a .meta file?"
exit 1
else
echo "Great, all .meta files are commited."
fi
working-directory: RuntimeUnitTestToolkit
- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
with:
directory: RuntimeUnitTestToolkit

# Store artifacts.
- uses: actions/upload-artifact@v1
Expand All @@ -116,9 +63,10 @@ jobs:
path: ./RuntimeUnitTestToolkit/RuntimeUnitTestToolkit.${{ env.GIT_TAG }}.unitypackage

create-release:
if: github.event.inputs.dry_run == 'false'
if: github.event.inputs.dry-run == 'false'
needs: [update-packagejson, build-unity]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Create Release
- uses: actions/create-release@v1
Expand All @@ -144,14 +92,8 @@ jobs:
asset_content_type: application/octet-stream

cleanup:
if: github.event.inputs.dry_run == 'true'
needs: [build-unity]
runs-on: ubuntu-latest
env:
GIT_TAG: ${{ github.event.inputs.tag }}
steps:
- name: Delete branch
uses: dawidd6/action-delete-branch@v3
with:
github_token: ${{ github.token }}
branches: ${{ env.DRY_RUN_BRANCH_PREFIX }}-${{ env.GIT_TAG }}
if: needs.update-packagejson.outputs.is-branch-created == 'true'
needs: [update-packagejson, build-unity]
uses: Cysharp/Actions/.github/workflows/clean-packagejson-branch.yaml@main
with:
branch: ${{ needs.update-packagejson.outputs.branch-name }}
10 changes: 10 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Close stale issues"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
uses: Cysharp/Actions/.github/workflows/stale-issue.yaml@main