From b5356375f1185121a4798a0efbf3e91696a9b59f Mon Sep 17 00:00:00 2001 From: robGG1997 Date: Thu, 14 Sep 2023 11:30:11 +0300 Subject: [PATCH 1/6] Revert "automated duplicating imported samples modifications (#595)" This reverts commit a5558941827a91df51e2dd200648dcd13a1231c8. --- .github/workflows/duplicate_sample.yaml | 28 ------------------- duplicate_package_sample.sh | 14 ---------- .../Samples~/Web3.Unity/Prefabs.meta | 8 ------ .../Samples~/Web3.Unity/Scenes.meta | 8 ------ .../Samples~/Web3.Unity/Scripts.meta | 8 ------ .../Samples~/Web3.Unity/Sprites.meta | 8 ------ 6 files changed, 74 deletions(-) delete mode 100644 .github/workflows/duplicate_sample.yaml delete mode 100644 duplicate_package_sample.sh delete mode 100644 src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs.meta delete mode 100644 src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes.meta delete mode 100644 src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts.meta delete mode 100644 src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Sprites.meta diff --git a/.github/workflows/duplicate_sample.yaml b/.github/workflows/duplicate_sample.yaml deleted file mode 100644 index 793149e56..000000000 --- a/.github/workflows/duplicate_sample.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Duplicate-Package-Sample - -on: - push: - branches: - - main - -jobs: - duplicate: - name: duplicate package sample - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Run duplicate script file - run: bash ${GITHUB_WORKSPACE}/duplicate_package_sample.sh - - - name: Commit and Push - run: | - git config --global user.email $git_email - git config --global user.name "${{ github.actor }}" - git add ./src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/. -f - git diff-index --cached --quiet HEAD || git commit -m "Auto-duplicate Package Samples" - git push - env: - git_email: "${{ github.actor }}@users.noreply.github.com" \ No newline at end of file diff --git a/duplicate_package_sample.sh b/duplicate_package_sample.sh deleted file mode 100644 index f3a677742..000000000 --- a/duplicate_package_sample.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Specify the source directory and the destination directory -SOURCE_DIRECTORY="src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0-pre001/Web3.Unity Samples/" -DESTINATION_DIRECTORY="src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/" - -# clear destination directory first -rm -r "$DESTINATION_DIRECTORY" - -# Copy source to the destination -cp -r "$SOURCE_DIRECTORY" "$DESTINATION_DIRECTORY" - -#add all modified files -git add "src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/." -f \ No newline at end of file diff --git a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs.meta b/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs.meta deleted file mode 100644 index 5b35daff8..000000000 --- a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 45a04d2621549e3458049c6c447c3941 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes.meta b/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes.meta deleted file mode 100644 index 5488a62ed..000000000 --- a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f39f8dda9616349489a7803d7e0aff30 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts.meta b/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts.meta deleted file mode 100644 index 9a1e8b8d4..000000000 --- a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: eaef630f284e6e04a88b5939e0eb1cc5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Sprites.meta b/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Sprites.meta deleted file mode 100644 index 7175ee89d..000000000 --- a/src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Sprites.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0c06517aee7843642a091a67c72b1379 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: From 2461a8d45d00b19ddf1e6df0ddda9ada4a9a9e8b Mon Sep 17 00:00:00 2001 From: robGG1997 Date: Mon, 6 Nov 2023 10:33:31 +0300 Subject: [PATCH 2/6] auto commit on PR then run tests manually on labeling with ready-to-merge --- .github/workflows/duplicate_samples.yml | 4 +++- .github/workflows/pre_pull_request_checks.yml | 11 +++-------- .github/workflows/publish_dependencies.yml | 4 +++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/duplicate_samples.yml b/.github/workflows/duplicate_samples.yml index 065453f78..ed9f0b55c 100644 --- a/.github/workflows/duplicate_samples.yml +++ b/.github/workflows/duplicate_samples.yml @@ -1,7 +1,9 @@ name: Duplicate Packages Samples Workflow on: - workflow_call: + pull_request: + branches: + - main jobs: duplicate: diff --git a/.github/workflows/pre_pull_request_checks.yml b/.github/workflows/pre_pull_request_checks.yml index b9a23fe4a..3c63a367f 100644 --- a/.github/workflows/pre_pull_request_checks.yml +++ b/.github/workflows/pre_pull_request_checks.yml @@ -3,19 +3,14 @@ name: Merge Checks on: pull_request: branches: [ main ] + types: + - labeled jobs: - duplicate_samples: - name: Duplicate Samples - uses: ChainSafe/web3.unity/.github/workflows/duplicate_samples.yml@main - publish_dependencies: - name: Publish Dependencies - uses: ChainSafe/web3.unity/.github/workflows/publish_dependencies.yml@main - needs: [duplicate_samples] web3_tests: name: Web3 Tests + if: ${{ github.event.label.name == 'ready-to-merge' }} uses: ChainSafe/web3.unity/.github/workflows/test.yaml@main - needs: [publish_dependencies] unity_tests: name: Unity Tests uses: ChainSafe/web3.unity/.github/workflows/unity_tests.yml@main diff --git a/.github/workflows/publish_dependencies.yml b/.github/workflows/publish_dependencies.yml index 39dea9aca..421d46c4e 100644 --- a/.github/workflows/publish_dependencies.yml +++ b/.github/workflows/publish_dependencies.yml @@ -1,7 +1,9 @@ name: Publish Solution Dependencies on: - workflow_call: + pull_request: + branches: + - main jobs: publish: From cadd08e4157c7847abd07abb000bf31f26a8bcb7 Mon Sep 17 00:00:00 2001 From: robGG1997 Date: Mon, 6 Nov 2023 11:52:36 +0300 Subject: [PATCH 3/6] trigger checks when PR is out of draft and ready for review too --- .github/workflows/pre_pull_request_checks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre_pull_request_checks.yml b/.github/workflows/pre_pull_request_checks.yml index 3c63a367f..9529c9c16 100644 --- a/.github/workflows/pre_pull_request_checks.yml +++ b/.github/workflows/pre_pull_request_checks.yml @@ -5,11 +5,12 @@ on: branches: [ main ] types: - labeled + - ready_for_review jobs: web3_tests: name: Web3 Tests - if: ${{ github.event.label.name == 'ready-to-merge' }} + if: ${{ github.event.action == 'ready_for_review' || github.event.label.name == 'ready-to-merge'}} uses: ChainSafe/web3.unity/.github/workflows/test.yaml@main unity_tests: name: Unity Tests From cc634165b03983cc29b36ba88fe655471e05b99d Mon Sep 17 00:00:00 2001 From: robGG1997 Date: Mon, 6 Nov 2023 14:05:09 +0300 Subject: [PATCH 4/6] reverted auto commit actions triggers to workflow call and added a new workflow for making auto commits This is done to avoid a head ref error when trying to make two pushes simultaneously --- .github/workflows/duplicate_samples.yml | 4 +--- .github/workflows/publish_dependencies.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/duplicate_samples.yml b/.github/workflows/duplicate_samples.yml index ed9f0b55c..065453f78 100644 --- a/.github/workflows/duplicate_samples.yml +++ b/.github/workflows/duplicate_samples.yml @@ -1,9 +1,7 @@ name: Duplicate Packages Samples Workflow on: - pull_request: - branches: - - main + workflow_call: jobs: duplicate: diff --git a/.github/workflows/publish_dependencies.yml b/.github/workflows/publish_dependencies.yml index 421d46c4e..39dea9aca 100644 --- a/.github/workflows/publish_dependencies.yml +++ b/.github/workflows/publish_dependencies.yml @@ -1,9 +1,7 @@ name: Publish Solution Dependencies on: - pull_request: - branches: - - main + workflow_call: jobs: publish: From 7655e167365b47768d94292849dbadfbce084268 Mon Sep 17 00:00:00 2001 From: robGG1997 Date: Mon, 6 Nov 2023 14:05:30 +0300 Subject: [PATCH 5/6] new workflow for auto commiting --- .../workflows/pre_pull_request_auto_commits.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/pre_pull_request_auto_commits.yml diff --git a/.github/workflows/pre_pull_request_auto_commits.yml b/.github/workflows/pre_pull_request_auto_commits.yml new file mode 100644 index 000000000..1e548104e --- /dev/null +++ b/.github/workflows/pre_pull_request_auto_commits.yml @@ -0,0 +1,14 @@ +name: Auto Commits + +on: + pull_request: + branches: [ main ] + +jobs: + duplicate_samples: + name: Duplicate Samples + uses: ChainSafe/web3.unity/.github/workflows/duplicate_samples.yaml@main + publish_dependencies: + name: Publish Dependencies + uses: ChainSafe/web3.unity/.github/workflows/publish_dependencies.yml@main + needs: [duplicate_samples] \ No newline at end of file From 0bb29923ec12b360ac27fdd5a797b3bcfe68653b Mon Sep 17 00:00:00 2001 From: robGG1997 Date: Mon, 6 Nov 2023 14:06:33 +0300 Subject: [PATCH 6/6] small typo fix --- .github/workflows/pre_pull_request_auto_commits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre_pull_request_auto_commits.yml b/.github/workflows/pre_pull_request_auto_commits.yml index 1e548104e..0c572377b 100644 --- a/.github/workflows/pre_pull_request_auto_commits.yml +++ b/.github/workflows/pre_pull_request_auto_commits.yml @@ -7,7 +7,7 @@ on: jobs: duplicate_samples: name: Duplicate Samples - uses: ChainSafe/web3.unity/.github/workflows/duplicate_samples.yaml@main + uses: ChainSafe/web3.unity/.github/workflows/duplicate_samples.yml@main publish_dependencies: name: Publish Dependencies uses: ChainSafe/web3.unity/.github/workflows/publish_dependencies.yml@main