这是indexloc提供的服务,不要输入任何密码
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
2 changes: 1 addition & 1 deletion .github/workflows/duplicate_samples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Duplicate Samples
name: Duplicate Samples 🪞

on:
workflow_call:
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/pull_request_checks.yml

This file was deleted.

12 changes: 8 additions & 4 deletions .github/workflows/pull_request_checks_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ on:
- ready_for_review

jobs:
pull_reqest_checks:
name: Pull Request Checks
uses: ChainSafe/web3.unity/.github/workflows/pull_request_checks.yml@main
secrets: inherit
web3_tests:
name: Web3 tests 🕸
if: ${{ github.event.action == 'ready_for_review' || github.event.label.name == 'ready-to-merge'}}
uses: ChainSafe/web3.unity/.github/workflows/test.yaml@main
analyze_code:
name: Analyze 🧐
if: ${{ github.event.action == 'ready_for_review' || github.event.label.name == 'ready-to-merge'}}
uses: ChainSafe/web3.unity/.github/workflows/codeql.yml@main
51 changes: 48 additions & 3 deletions .github/workflows/pull_request_checks_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,54 @@ on:
types:
- labeled
- ready_for_review
- synchronize

jobs:
pull_reqest_checks:
name: Pull Request Checks
uses: ChainSafe/web3.unity/.github/workflows/pull_request_checks.yml@main
check_commit:
name: Check Commit 📝
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
commit_message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
lfs: true
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Get Head Commit Message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

pre_job:
name: Pre Job 🚀
runs-on: ubuntu-latest
if: ${{ needs.check_commit.outputs.commit_message == 'Sync Dependencies - Auto Commit' }}
needs: [ check_commit ]
steps:
- run: echo "..."

web3_tests:
name: Web3 tests 🕸
uses: ChainSafe/web3.unity/.github/workflows/test.yaml@main
needs: [ pre_job ]
analyze_code:
name: Analyze 🧐
uses: ChainSafe/web3.unity/.github/workflows/codeql.yml@main
needs: [ pre_job ]
unity_tests:
name: Unity Tests 🧪
uses: ChainSafe/web3.unity/.github/workflows/unity_tests.yml@main
needs: [ pre_job ]
secrets: inherit
duplicate_samples:
name: Duplicate Samples 🪞
if: ${{ github.event.action == 'ready_for_review' || github.event.label.name == 'ready-to-merge'}}
uses: ChainSafe/web3.unity/.github/workflows/duplicate_samples.yaml@main
secrets: inherit
sync_dependencies:
name: Sync Dependencies 🔄
uses: ChainSafe/web3.unity/.github/workflows/sync_dependencies.yaml@main
needs: [ duplicate_samples ]
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/sync_branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
git config user.email $git_email
git config user.name $git_actor
git fetch origin ${{ github.event.inputs.branch }}
git checkout ${{ github.event.inputs.branch }}
git pull
git merge main --allow-unrelated-histories
git push
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sync Dependencies
name: Sync Dependencies 🔄

on:
workflow_call:
Expand Down
13 changes: 9 additions & 4 deletions Setup/Git.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,20 @@ public static void Add(string path)
$"git add \"{path}\" -f".Run();
}

public static void Commit(string message, string[] tags = null)
public static void Commit(string message, string[] tags = null, bool skipCi = true)
{
if (!_configured)
{
Configure();
}

if (skipCi)
{
message += " [skip ci]";
}

// Checks if there are any changes to commit before committing
$"git diff-index --cached --quiet HEAD || git commit -m \"{message} [skip ci]\"".Run();
$"git diff-index --cached --quiet HEAD || git commit -m \"{message}\"".Run();

if (tags != null)
{
Expand Down Expand Up @@ -72,9 +77,9 @@ public static void Push(string[] tags = null)
}
}

public static void CommitAndPush(string message, string[] tags = null)
public static void CommitAndPush(string message, string[] tags = null, bool skipCi = true)
{
Commit(message, tags);
Commit(message, tags, skipCi);

Push(tags);
}
Expand Down
2 changes: 1 addition & 1 deletion Setup/SyncDependencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void Run()
Git.Add(destination);
}

Git.CommitAndPush("Sync Dependencies");
Git.CommitAndPush("Sync Dependencies - Auto Commit", skipCi: false);

Console.WriteLine("Dependencies Synced Successfully!");
}
Expand Down