mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
merged master
This commit is contained in:
commit
2f9b92697f
8
.github/CreateRelease.cs
vendored
8
.github/CreateRelease.cs
vendored
@ -8,27 +8,27 @@
|
||||
string text = File.ReadAllText(path);
|
||||
|
||||
// Find the whole line of the first define ending with "MIRROR_n_OR_NEWER,"
|
||||
string pattern = @"\s+\""(MIRROR_(\d+)_OR_NEWER)\""\,\r\n";
|
||||
string pattern = @"\s+\""(MIRROR_(\d+)_OR_NEWER)\""\,\n";
|
||||
Match match = Regex.Matches(text, pattern).First();
|
||||
|
||||
// Remove the first define
|
||||
text = text.Replace(match.Value, "");
|
||||
|
||||
// Find the highest version number entry, not having a comma at the end
|
||||
pattern = @"\""(MIRROR_(\d+)_OR_NEWER)\""\r\n";
|
||||
pattern = @"\""(MIRROR_(\d+)_OR_NEWER)\""\n";
|
||||
MatchCollection matches = Regex.Matches(text, pattern);
|
||||
int maxVersion = matches.Max(m => int.Parse(m.Groups[2].Value));
|
||||
|
||||
// Find the last define ending with "MIRROR_n_OR_NEWER"
|
||||
pattern = @"(\s+)\""(MIRROR_(\d+)_OR_NEWER)\""";
|
||||
MatchCollection matches = Regex.Matches(text, pattern);
|
||||
matches = Regex.Matches(text, pattern);
|
||||
Match lastMatch = matches.Last();
|
||||
|
||||
// Add a new define for the next full version, used here and in ProjectSettings and version.txt
|
||||
string newDefine = $"MIRROR_{maxVersion + 1}_OR_NEWER";
|
||||
|
||||
// Add the new define to the end of the hashset entries, with a comma after the previous entry and properly indented
|
||||
text = text.Insert(lastMatch.Index + lastMatch.Length, $",\r\n{match.Groups[1].Value}\"{newDefine}\"");
|
||||
text = text.Insert(lastMatch.Index + lastMatch.Length, $",\n{match.Groups[1].Value}\"{newDefine}\"");
|
||||
|
||||
File.WriteAllText(path, text);
|
||||
|
||||
|
27
.github/workflows/CreateRelease.yml
vendored
27
.github/workflows/CreateRelease.yml
vendored
@ -14,17 +14,20 @@ jobs:
|
||||
|
||||
- name: Merge master into AssetStoreRelease
|
||||
run: |
|
||||
git config --local user.name ${{ secrets.COMMITTER_NAME }}
|
||||
git config --local user.email ${{ secrets.COMMITTER_EMAIL }}
|
||||
git fetch origin master --depth 1
|
||||
git rebase origin/master
|
||||
git reset --hard origin/master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 3.1.301
|
||||
#with:
|
||||
# dotnet-version: 3.1.301
|
||||
|
||||
- name: Install dotnet-script
|
||||
run: |
|
||||
dotnet tool install -g dotnet-script
|
||||
dotnet script --version
|
||||
|
||||
- name: Run CreateRelease.cs
|
||||
run: |
|
||||
@ -32,8 +35,18 @@ jobs:
|
||||
|
||||
- name: Commit and Push
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git config --local user.name ${{ secrets.COMMITTER_NAME }}
|
||||
git config --local user.email ${{ secrets.COMMITTER_EMAIL }}
|
||||
git add Assets/Mirror/version.txt
|
||||
git commit -m "release!: Asset Store Release" -a
|
||||
|
||||
# Configure Git to rebase when pulling
|
||||
git config --local pull.rebase true
|
||||
|
||||
# Perform a git pull to update the local branch with remote changes
|
||||
git pull origin AssetStoreRelease
|
||||
|
||||
# Push the updated branch to the remote
|
||||
git push origin AssetStoreRelease
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
Loading…
Reference in New Issue
Block a user