Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
201d763
changed checkout ref to target and added base input
rob1997 Nov 27, 2024
4653680
test run
rob1997 Nov 27, 2024
0950269
workflow file ref changed
rob1997 Nov 27, 2024
993933f
change the base branch since main and dev are upto date
rob1997 Nov 27, 2024
2c27324
added some logs for debugging
rob1997 Nov 27, 2024
bd05d99
more logs
rob1997 Nov 27, 2024
c4732b1
check with correct inputs
rob1997 Nov 27, 2024
c144efb
logs and added fetch just in case
rob1997 Nov 27, 2024
0cadd2a
cutting my losses and trying a third party action
rob1997 Nov 27, 2024
1ec1acf
skip ci added
rob1997 Nov 27, 2024
cb42309
skip CI inputs added
rob1997 Nov 27, 2024
45f7c8e
remove required from skip_ci input
rob1997 Nov 27, 2024
17cfb55
apparently $ runs commands in bash
rob1997 Nov 27, 2024
93a36b0
maybe pipe it
rob1997 Nov 27, 2024
b0c34ac
cutting my loses again
rob1997 Nov 27, 2024
35468a3
trying some stuff
rob1997 Nov 27, 2024
0b1dc21
trying something from stackoverflow
rob1997 Nov 27, 2024
68d2254
small edits
rob1997 Nov 27, 2024
f4f874c
smaller edits
rob1997 Nov 27, 2024
efb04cb
bash is so weird
rob1997 Nov 27, 2024
e863689
message formatting
rob1997 Nov 27, 2024
1eab7cf
input options implemented
rob1997 Nov 27, 2024
45960bd
typo fix
rob1997 Nov 27, 2024
7e8eef6
more typo fixes :facepalm
rob1997 Nov 27, 2024
331b331
reverted testing refs
rob1997 Nov 27, 2024
252869a
typo fix
rob1997 Nov 27, 2024
a2ae15b
checking regular git commands if they work
rob1997 Nov 27, 2024
5787a52
logs and fetch
rob1997 Nov 27, 2024
e9ae835
log latest commit
rob1997 Nov 27, 2024
0961c31
changed checkout branch at step removed branch log
rob1997 Nov 27, 2024
2788ff0
log last commit command replaced
rob1997 Nov 27, 2024
5924ce5
log status
rob1997 Nov 27, 2024
d799125
checkout at base branch
rob1997 Nov 27, 2024
5438465
added git branch to find base branch
rob1997 Nov 27, 2024
c35a5e4
trying more combinations
rob1997 Nov 27, 2024
12913c2
updated dev PR checks to trigger with multiple labels
rob1997 Nov 27, 2024
9c61e1b
setup now uses a proper command line parser
rob1997 Nov 28, 2024
65e4f0d
updated workflows with new command line parameters
rob1997 Nov 28, 2024
cf02efb
updated local scripts with new arguments
rob1997 Nov 28, 2024
f939e51
text formatting
rob1997 Nov 28, 2024
1b69fb5
updated release argument
rob1997 Nov 28, 2024
2bf7590
-r is also already in use, --deploy
rob1997 Nov 28, 2024
fc96760
typo fix
rob1997 Nov 28, 2024
91fe663
arguments fix for sync verb
rob1997 Nov 28, 2024
0f2171d
fixed skip ci option
rob1997 Nov 28, 2024
4ed71d7
changed setup ref
rob1997 Nov 28, 2024
336deb7
typo fix
rob1997 Nov 28, 2024
6581876
fixing some parsing issues
rob1997 Nov 28, 2024
3d7e407
added a . at the end of path because git isn't finding path
rob1997 Nov 28, 2024
3b26430
logging and trying something I found on git
rob1997 Nov 28, 2024
106b145
more logs and messing with directory
rob1997 Nov 28, 2024
5bdf767
fixed path
rob1997 Nov 28, 2024
c69af48
allow unrelated histories
rob1997 Nov 28, 2024
726aa2a
empty trigger
rob1997 Nov 28, 2024
bdef481
more logging
rob1997 Nov 28, 2024
2535b6f
typo fixed
rob1997 Nov 28, 2024
9bf1891
trial without exclusion logic
rob1997 Nov 28, 2024
796afb8
reverted changes
rob1997 Nov 28, 2024
be45dc7
added git log on checkout
rob1997 Nov 28, 2024
ac4a02b
reverted log
rob1997 Nov 28, 2024
d24c0e2
added some merge options
rob1997 Nov 28, 2024
dde4e9e
merging the other way
rob1997 Nov 28, 2024
685ae00
reverted reverse merging
rob1997 Nov 28, 2024
d818f8e
check if history is related
rob1997 Nov 28, 2024
8321b39
checking target's last commits
rob1997 Nov 28, 2024
4e66aea
more logs
rob1997 Nov 28, 2024
ddc158a
one line logging
rob1997 Nov 28, 2024
8e095f4
GH actions is running one commit branches :faceplam
rob1997 Nov 28, 2024
017501d
what happens if I force pull do I get all the commits?
rob1997 Nov 28, 2024
8ba436c
TIL GitHub only fetches one commit from head by default
rob1997 Nov 28, 2024
4579d1e
revert back testing changes
rob1997 Nov 28, 2024
14345c5
added back config input for sync dependencies
rob1997 Nov 28, 2024
6cf695c
ci shouldn't be skipped on dev (for extra commits)
rob1997 Dec 3, 2024
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
15 changes: 1 addition & 14 deletions .github/workflows/duplicate_samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,12 @@ name: Duplicate Samples 🪞
on:
workflow_call:
workflow_dispatch:
inputs:
arguments:
required: false
description: 'Run Arguments'
type: string
configuration:
required: true
description: 'Run Configuration'
default: 'Release'
type: choice
options:
- Release
- Debug

jobs:
setup:
name: Duplicate Samples 🪞
uses: ChainSafe/web3.unity/.github/workflows/setup.yaml@main
with:
arguments: "-duplicate_samples ${{ github.event.inputs.arguments || '-git:enabled' }} -c ${{ github.event.inputs.configuration || 'Release' }}"
arguments: "-d"
secrets: inherit

13 changes: 10 additions & 3 deletions .github/workflows/pull_request_checks_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ on:
- ready_for_review

jobs:
pre_job:
name: Pre Job 🚀
runs-on: ubuntu-latest
if: ${{ github.event.action == 'ready_for_review' || (!github.event.pull_request.draft && contains( github.event.pull_request.labels.*.name, 'ready-to-merge')) }}
steps:
- run: echo "Proceeding to checks..."
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
needs: [ pre_job ]
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
needs: [ pre_job ]
documentation_check:
name: Documentation Check 📚
uses: ChainSafe/web3.unity/.github/workflows/documentation_check.yml@main
uses: ChainSafe/web3.unity/.github/workflows/documentation_check.yml@main
needs: [ pre_job ]
4 changes: 3 additions & 1 deletion .github/workflows/push_checks_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ jobs:
name: Sync Branches ♾️
uses: ChainSafe/web3.unity/.github/workflows/sync_branches.yaml@main
with:
branch: dev
base: main
target: dev
skip_ci: false
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Setup job
uses: ChainSafe/web3.unity/.github/workflows/setup.yaml@main
with:
arguments: "-release:${{ github.event.inputs.version }}"
arguments: "--deploy ${{ github.event.inputs.version }}"
secrets: inherit
release:
name: Release job
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@ on:
arguments:
required: true
type: string
configuration:
required: false
type: string
default: "Release"
workflow_dispatch:
inputs:
arguments:
required: true
description: 'Arguments to pass to the setup script'
type: string
configuration:
required: true
description: 'Run Configuration'
default: 'Release'
type: choice
options:
- Release
- Debug
env:
git_email: "${{ github.actor }}@users.noreply.github.com"
git_actor: "${{ github.actor }}"
Expand All @@ -28,6 +40,7 @@ jobs:
lfs: true
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive
fetch-depth: 100
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand All @@ -36,10 +49,5 @@ jobs:
- name: Run
run: |
cd Setup
dotnet run ${{ inputs.arguments || github.event.inputs.arguments }} Setup/Setup.csproj
git reset --hard
- name: Cache
uses: actions/cache/save@v4
with:
path: .git
key: ${{ runner.os }}-git
dotnet run ${{ inputs.arguments || github.event.inputs.arguments }} -c ${{ inputs.configuration || github.event.inputs.configuration }}
git reset --hard
48 changes: 23 additions & 25 deletions .github/workflows/sync_branches.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
name: Sync Branches
name: Sync Branches ♾️

on:
workflow_call:
inputs:
branch:
base:
required: true
type: string
target:
required: true
type: string
skip_ci:
type: boolean
default: true
workflow_dispatch:
inputs:
branch:
base:
required: true
description: "Branch to Sync"
description: "Base branch to Sync"
type: string
target:
required: true
description: "Target branch to Sync"
type: string
skip_ci:
required: true
description: "Should push skip CI"
type: boolean
default: true

jobs:
setup:
name: Sync Branches ♾️
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
lfs: true
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Sync Branches
run: |
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
env:
git_email: "${{ github.actor }}@users.noreply.github.com"
git_actor: "${{ github.actor }}"
uses: ChainSafe/web3.unity/.github/workflows/setup.yaml@rob/sync-branches-ci-fix
with:
arguments: "sync -b ${{ github.event.inputs.base || inputs.base }} -t ${{ github.event.inputs.target || inputs.target }} -s ${{ github.event.inputs.skip_ci || inputs.skip_ci }}"
secrets: inherit
7 changes: 2 additions & 5 deletions .github/workflows/sync_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
workflow_call:
workflow_dispatch:
inputs:
arguments:
required: false
description: 'Run Arguments'
type: string
configuration:
required: true
description: 'Run Configuration'
Expand All @@ -22,6 +18,7 @@ jobs:
name: Sync Dependencies 🔄
uses: ChainSafe/web3.unity/.github/workflows/setup.yaml@main
with:
arguments: "-sync_dependencies ${{ github.event.inputs.arguments || '-git:enabled' }} -c ${{ github.event.inputs.configuration || 'Release' }}"
arguments: "-s"
configuration: ${{ github.event.inputs.configuration || 'Release' }}
secrets: inherit

47 changes: 47 additions & 0 deletions Setup/DefaultOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Collections.Generic;
using CommandLine;
using Setup.Utils;

namespace Setup;

[Verb("do", true, HelpText = "Runs default options.")]
public class DefaultOptions
{
[Option('s', "sync_dependencies", Required = false, Default = false, HelpText = "Generate and copy dependencies to Sample Project.")]
public bool SyncDependencies { get; set; }

[Option('d', "duplicate_samples", Required = false, Default = false, HelpText = "Duplicate samples in Sample Project into package samples.")]
public bool DuplicateSamples { get; set; }

[Option("deploy", Required = false, HelpText = "Version to release.")]
public string Release { get; set; }

[Option('g', "git", Required = false, Default = true, HelpText = "Enable Git.")]
public bool? EnableGit { get; set; }

public List<IRunnable> GetRunnableList()
{
List<IRunnable> runnableList = new List<IRunnable>();

if (SyncDependencies)
{
runnableList.Add(new SyncDependencies());
}

if (DuplicateSamples)
{
runnableList.Add(new DuplicateSamples());
}

if (!string.IsNullOrEmpty(Release))
{
runnableList.Add(new Release(Release));
}

EnableGit ??= false;

runnableList.Add(new Git(EnableGit.Value));

return runnableList;
}
}
Loading