Skip to content

Commit 9988879

Browse files
authored
Merge pull request #154 from Erol444/develop
new core
2 parents dbcea6d + 7ae9d4d commit 9988879

File tree

656 files changed

+84638
-48331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+84638
-48331
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,39 @@ on:
88

99
jobs:
1010
build:
11+
strategy:
12+
matrix:
13+
server: [TRAVIAN_OFFICIAL, TRAVIAN_OFFICIAL_HEROUI, TTWARS]
1114
runs-on: windows-2019
1215
steps:
13-
- name: setup-msbuild
14-
uses: microsoft/setup-msbuild@v1
15-
16-
- name: Setup NuGet
17-
uses: NuGet/[email protected]
16+
- name: Setup dotnet
17+
uses: actions/setup-dotnet@v2
18+
with:
19+
dotnet-version: 6.0.x
1820

1921
- name: 'Checkout repo'
2022
uses: actions/checkout@v2
2123

2224
- name: Navigate to Workspace
2325
run: cd $GITHUB_WORKSPACE
24-
25-
- name: Get cache
26-
uses: actions/cache@v2
27-
with:
28-
path: |
29-
packages
30-
TbsCore/obj/project.assets.json
31-
TbsCore/TbsCore.csproj.nuget.g.targets
32-
TbsCore/TbsCore.csproj.nuget.g.props.
33-
key: ${{ runner.os }}-nuget-${{ hashFiles('TbsCore/packages.lock.json') }}
34-
restore-keys: |
35-
${{ runner.os }}-nuget-
36-
37-
- name: Restore Packages
38-
run: |
39-
nuget restore TbsCore/TbsCore.csproj -PackagesDirectory packages
40-
nuget restore TravBotSharp/TbsWinForms.csproj -PackagesDirectory packages
4126

4227
- name: Build Bot
43-
run: |
44-
msbuild.exe TravBotSharp.sln /t:TbsWinForms /nologo /nr:false /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release" /m /p:BuildProjectReferences=true /p:BUILD_NUMBER=30.4.1975.0
28+
run: dotnet publish WPFUI -c Release --self-contained true -p:PublishSingleFile=true -r win-x86 -p:Server=${{ matrix.server }}
4529

4630
- name: Upload a Build Artifact
4731
uses: actions/upload-artifact@v2
4832
with:
49-
name: TBS-Build-${{ github.sha }}
50-
path: TravBotSharp\bin\Release
33+
name: TBS-Build-${{ matrix.server }}-${{ github.run_id }}
34+
path: WPFUI\bin\Release\net6.0-windows\win-x86\publish\
5135
if-no-files-found: error
52-
53-
- name: Comment on PR when success
54-
uses: actions/[email protected]
55-
if: |
56-
github.event_name == 'pull_request' && success()
57-
with:
58-
github-token: ${{ secrets.GITHUB_TOKEN }}
59-
script: |
60-
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
61-
github.issues.createComment({ issue_number, owner, repo, body: "Congratulation this commit was built successfully. Check detail [here](https://github.com/Erol444/TravianBotSharp/actions/runs/${{ github.run_id }}?check_suite_focus=true)" });
62-
63-
- name: Comment on PR when fail
64-
uses: actions/[email protected]
65-
if: |
66-
github.event_name == 'pull_request' && failure()
36+
commentor:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Comment PR
41+
uses: thollander/[email protected]
6742
with:
68-
github-token: ${{ secrets.GITHUB_TOKEN }}
69-
script: |
70-
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
71-
github.issues.createComment({ issue_number, owner, repo, body: "There is error while building this commit. Check detail [here](https://github.com/Erol444/TravianBotSharp/actions/runs/${{ github.run_id }}?check_suite_focus=true)" });
43+
message: Click [here](https://nightly.link/Erol444/TravianBotSharp/actions/runs/${{ github.run_id }}) to check the build
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7245

46+

.github/workflows/pre-release.yml

Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
runs-on: ubuntu-latest
1313
outputs:
1414
version: ${{ steps.semvers.outputs.patch }}
15-
changelog: ${{ steps.Changelog.outputs.changelog }}
1615
steps:
1716
- uses: docker://agilepathway/pull-request-label-checker:latest
1817
with:
@@ -34,86 +33,64 @@ jobs:
3433
uses: "WyriHaximus/github-action-next-semvers@v1"
3534
with:
3635
version: ${{ steps.previoustag.outputs.tag }}
37-
38-
- name: 'Create changelog'
39-
id: Changelog
40-
run: |
41-
changelog="${{github.event.pull_request.body}}"
42-
changelog="${changelog//'%'/'%25'}"
43-
changelog="${changelog//$'\n'/'%0A'}"
44-
changelog="${changelog//$'\r'/'%0D'}"
45-
echo "::set-output name=changelog::$changelog"
4636

4737
build:
4838
runs-on: windows-2019
4939
needs: version
40+
strategy:
41+
matrix:
42+
server: [TRAVIAN_OFFICIAL, TRAVIAN_OFFICIAL_HEROUI, TTWARS]
5043
steps:
51-
- name: setup-msbuild
52-
uses: microsoft/setup-msbuild@v1
53-
54-
- uses: actions/checkout@v2
55-
56-
- name: Setup NuGet
57-
uses: NuGet/[email protected]
44+
- name: Setup dotnet
45+
uses: actions/setup-dotnet@v2
46+
with:
47+
dotnet-version: 6.0.x
5848

49+
- name: 'Checkout repo'
50+
uses: actions/checkout@v2
51+
5952
- name: Navigate to Workspace
6053
run: cd $GITHUB_WORKSPACE
6154

62-
- name: Get cache
63-
uses: actions/cache@v2
64-
with:
65-
path: |
66-
packages
67-
TbsCore/obj/project.assets.json
68-
TbsCore/TbsCore.csproj.nuget.g.targets
69-
TbsCore/TbsCore.csproj.nuget.g.props.
70-
key: ${{ runner.os }}-nuget-${{ hashFiles('TbsCore/packages.lock.json') }}
71-
restore-keys: |
72-
${{ runner.os }}-nuget-
73-
74-
- name: Restore Packages
75-
run: |
76-
nuget restore TbsCore/TbsCore.csproj -PackagesDirectory packages
77-
nuget restore TravBotSharp/TbsWinForms.csproj -PackagesDirectory packages
78-
7955
- name: Build Bot
80-
run: |
81-
msbuild.exe TravBotSharp.sln /t:TbsWinForms /nologo /nr:false /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release" /m /p:BuildProjectReferences=true /p:BUILD_NUMBER=${{needs.version.outputs.version}}.0
56+
run: dotnet publish WPFUI -c Release --self-contained true -p:PublishSingleFile=true -r win-x86 -p:Server=${{ matrix.server }} -p:AssemblyVersion=${{needs.version.outputs.version}}.0
8257

8358
- name: Upload a Build Artifact
8459
uses: actions/upload-artifact@v2
8560
with:
86-
name: TBS-prerelease
87-
path: TravBotSharp\bin\Release
61+
name: TBS-${{ matrix.server }}
62+
path: WPFUI\bin\Release\net6.0-windows\win-x86\publish\
8863
if-no-files-found: error
8964

9065
prerelease:
9166
runs-on: ubuntu-latest
9267
needs: [build, version]
9368
steps:
9469
- name: Download artifact
95-
uses: actions/download-artifact@master
70+
uses: actions/download-artifact@v3
9671
with:
97-
name: TBS-prerelease
98-
path: TBS-${{needs.version.outputs.version}}
72+
path: TBS
73+
9974
- name: Archive pre release
100-
uses: montudor/action-zip@v1
101-
with:
102-
args: zip -r TBS-${{needs.version.outputs.version}}.zip TBS-${{needs.version.outputs.version}}
75+
run: |
76+
cd TBS; zip -r "TBS-${{needs.version.outputs.version}}-TravianOfficial-OldHeroUI.zip" TBS-TRAVIAN_OFFICIAL; cp -R "TBS-${{needs.version.outputs.version}}-TravianOfficial-OldHeroUI.zip" ../; cd ..
77+
cd TBS; zip -r "TBS-${{needs.version.outputs.version}}-TravianOfficial-NewHeroUI.zip" TBS-TRAVIAN_OFFICIAL_HEROUI; cp -R "TBS-${{needs.version.outputs.version}}-TravianOfficial-NewHeroUI.zip" ../; cd ..
78+
cd TBS; zip -r "TBS-${{needs.version.outputs.version}}-TTWars.zip" TBS-TTWARS; cp -R "TBS-${{needs.version.outputs.version}}-TTWars.zip" ../; cd ..
10379
10480
- name: Create pre release
10581
uses: ncipollo/release-action@v1
10682
with:
107-
name: TBS-${{needs.version.outputs.version}}-pre
83+
name: TBS-${{needs.version.outputs.version}}
10884
prerelease: true
10985
tag: ${{needs.version.outputs.version}}
110-
commit: develop
86+
commit: develop
87+
artifacts: "TBS-${{needs.version.outputs.version}}-TravianOfficial-OldHeroUI.zip, TBS-${{needs.version.outputs.version}}-TravianOfficial-NewHeroUI.zip, TBS-${{needs.version.outputs.version}}-TTWars.zip"
88+
token: ${{ secrets.GITHUB_TOKEN }}
11189
body: |
112-
**Changelog**:
113-
${{needs.version.outputs.changelog}}
90+
This is pre-release version of TBS. Please report any bugs you found.
91+
Please join our Discord server for more information: [https://discord.gg/mBa4f2K](https://discord.gg/mBa4f2K)
92+
11493
115-
artifacts: TBS-${{needs.version.outputs.version}}.zip
116-
token: ${{ secrets.GITHUB_TOKEN }}
11794
Discord:
11895
runs-on: ubuntu-latest
11996
needs: [prerelease, version]
@@ -126,15 +103,15 @@ jobs:
126103
nodetail: true
127104
description: |
128105
Version `TBS-${{needs.version.outputs.version}}`
129-
Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download!
130-
131-
**Changelog**:
132-
${{needs.version.outputs.changelog}}
106+
Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download
133107
Clear:
134108
runs-on: ubuntu-latest
135109
needs: prerelease
110+
strategy:
111+
matrix:
112+
server: [TRAVIAN_OFFICIAL, TRAVIAN_OFFICIAL_HEROUI, TTWARS]
136113
steps:
137114
- name: Delete artifact
138115
uses: geekyeggo/delete-artifact@v1
139116
with:
140-
name: TBS-prerelease
117+
name: TBS-${{ matrix.server }}

0 commit comments

Comments
 (0)