-
Notifications
You must be signed in to change notification settings - Fork 9
feat: replace Bash to C# Batch #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
faa03e5
to
9962877
Compare
c4fb3e8
to
f2294c9
Compare
f2294c9
to
3d44e8f
Compare
e25032b
to
b42dda7
Compare
ae5c440
to
854cc09
Compare
7b30317
to
bff2c1b
Compare
9d27965
to
5f148bb
Compare
4d56332
to
df34e1d
Compare
df34e1d
to
6abba7c
Compare
8c76006
to
022c7db
Compare
0e7834c
to
66d8d72
Compare
61cad72
to
dd129f8
Compare
85be070
to
02ca8ab
Compare
48007f7
to
845f226
Compare
3eafacc
to
ac59662
Compare
07e03ee
to
3b16c1b
Compare
6604e3e
to
43bc59a
Compare
2428bfe
to
4c8f56d
Compare
5d169c6
to
20284ab
Compare
d5b0c1d
to
e469a10
Compare
4819bc4
to
76767d9
Compare
8c96fdc
to
291760e
Compare
Commit by [GitHub Actions](https://github.com/Cysharp/Actions/actions/runs/13382620883)
guitarrapc
added a commit
that referenced
this pull request
Feb 19, 2025
This reverts commit 9c59077.
guitarrapc
added a commit
that referenced
this pull request
Feb 19, 2025
This reverts commit f540f30.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tl;dr;
Cysharp Actions were previously written in Bash. While Bash is a GitHub Actions-friendly way to write lightweight logic, it became too complicated for us. This PR rewrites the Bash script using C# with Zx. We believe this change fits to us.
Bash
Bash has many benefits as it is a powerful shell:
Bash also has its difficulties due to its flexibility:
while read -r item; do ...; done <<< "${line_separated_string}"
for better handling. I just need a simple split by end-of-line and loop through it."foo.nupkg" == *.nupkg
. I just need to match the file extension.C# & Zx
To move from Bash to C#, we use Zx by ProcessX and ConsoleAppFramework. Change to C# make us easy to write unit tests.
ConsoleAppFramework offers the following:
foo-command --parameter value1 --array "ele1 ele2 ele3" --boolean-true
, to typed C# method parameterspublic void FooCommand(string parameter, string[] array, bool booleanTrue)
Zx offers the following:
await string
likeawait $"gh release upload {tag} {file}"
. This syntax drastically reduces how the process is called.Env.useShell = false
.C# also has difficulties due to Language specific.
Note
Workflow Updates:
.github/workflows/clean-packagejson-branch.yaml
: Simplified the cleanup job by removing the branch check step and using a new action to delete branches..github/workflows/create-release.yaml
: Added environment variables and permissions, and replaced manual steps with a new action for creating releases and uploading assets. [1] [2].github/workflows/test-actions.yaml
: Added a new workflow to test actions on pull requests to the main branch..github/workflows/test-update-packagejson.yaml
: Updated the workflow to check branch names and added environment variables..github/workflows/update-packagejson.yaml
: Added a new input for the checkout reference.Configuration File Updates:
.editorconfig
: Reorganized file types and added new diagnostic rules for C# standards and analyzer rulesets.