Skip to content

Commit

Permalink
Merge pull request #154 from Erol444/develop
Browse files Browse the repository at this point in the history
new core
  • Loading branch information
vinaghost authored Sep 30, 2022
2 parents dbcea6d + 7ae9d4d commit 9988879
Show file tree
Hide file tree
Showing 656 changed files with 84,638 additions and 48,331 deletions.
64 changes: 19 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,39 @@ on:

jobs:
build:
strategy:
matrix:
server: [TRAVIAN_OFFICIAL, TRAVIAN_OFFICIAL_HEROUI, TTWARS]
runs-on: windows-2019
steps:
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

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

- name: Navigate to Workspace
run: cd $GITHUB_WORKSPACE

- name: Get cache
uses: actions/cache@v2
with:
path: |
packages
TbsCore/obj/project.assets.json
TbsCore/TbsCore.csproj.nuget.g.targets
TbsCore/TbsCore.csproj.nuget.g.props.
key: ${{ runner.os }}-nuget-${{ hashFiles('TbsCore/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore Packages
run: |
nuget restore TbsCore/TbsCore.csproj -PackagesDirectory packages
nuget restore TravBotSharp/TbsWinForms.csproj -PackagesDirectory packages

- name: Build Bot
run: |
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
run: dotnet publish WPFUI -c Release --self-contained true -p:PublishSingleFile=true -r win-x86 -p:Server=${{ matrix.server }}

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: TBS-Build-${{ github.sha }}
path: TravBotSharp\bin\Release
name: TBS-Build-${{ matrix.server }}-${{ github.run_id }}
path: WPFUI\bin\Release\net6.0-windows\win-x86\publish\
if-no-files-found: error

- name: Comment on PR when success
uses: actions/[email protected]
if: |
github.event_name == 'pull_request' && success()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
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)" });
- name: Comment on PR when fail
uses: actions/[email protected]
if: |
github.event_name == 'pull_request' && failure()
commentor:
needs: build
runs-on: ubuntu-latest
steps:
- name: Comment PR
uses: thollander/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
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)" });
message: Click [here](https://nightly.link/Erol444/TravianBotSharp/actions/runs/${{ github.run_id }}) to check the build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


87 changes: 32 additions & 55 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semvers.outputs.patch }}
changelog: ${{ steps.Changelog.outputs.changelog }}
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
Expand All @@ -34,86 +33,64 @@ jobs:
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}

- name: 'Create changelog'
id: Changelog
run: |
changelog="${{github.event.pull_request.body}}"
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "::set-output name=changelog::$changelog"

build:
runs-on: windows-2019
needs: version
strategy:
matrix:
server: [TRAVIAN_OFFICIAL, TRAVIAN_OFFICIAL_HEROUI, TTWARS]
steps:
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1

- uses: actions/checkout@v2

- name: Setup NuGet
uses: NuGet/[email protected]
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

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

- name: Navigate to Workspace
run: cd $GITHUB_WORKSPACE

- name: Get cache
uses: actions/cache@v2
with:
path: |
packages
TbsCore/obj/project.assets.json
TbsCore/TbsCore.csproj.nuget.g.targets
TbsCore/TbsCore.csproj.nuget.g.props.
key: ${{ runner.os }}-nuget-${{ hashFiles('TbsCore/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore Packages
run: |
nuget restore TbsCore/TbsCore.csproj -PackagesDirectory packages
nuget restore TravBotSharp/TbsWinForms.csproj -PackagesDirectory packages
- name: Build Bot
run: |
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
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

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

prerelease:
runs-on: ubuntu-latest
needs: [build, version]
steps:
- name: Download artifact
uses: actions/download-artifact@master
uses: actions/download-artifact@v3
with:
name: TBS-prerelease
path: TBS-${{needs.version.outputs.version}}
path: TBS

- name: Archive pre release
uses: montudor/action-zip@v1
with:
args: zip -r TBS-${{needs.version.outputs.version}}.zip TBS-${{needs.version.outputs.version}}
run: |
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 ..
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 ..
cd TBS; zip -r "TBS-${{needs.version.outputs.version}}-TTWars.zip" TBS-TTWARS; cp -R "TBS-${{needs.version.outputs.version}}-TTWars.zip" ../; cd ..
- name: Create pre release
uses: ncipollo/release-action@v1
with:
name: TBS-${{needs.version.outputs.version}}-pre
name: TBS-${{needs.version.outputs.version}}
prerelease: true
tag: ${{needs.version.outputs.version}}
commit: develop
commit: develop
artifacts: "TBS-${{needs.version.outputs.version}}-TravianOfficial-OldHeroUI.zip, TBS-${{needs.version.outputs.version}}-TravianOfficial-NewHeroUI.zip, TBS-${{needs.version.outputs.version}}-TTWars.zip"
token: ${{ secrets.GITHUB_TOKEN }}
body: |
**Changelog**:
${{needs.version.outputs.changelog}}
This is pre-release version of TBS. Please report any bugs you found.
Please join our Discord server for more information: [https://discord.gg/mBa4f2K](https://discord.gg/mBa4f2K)
artifacts: TBS-${{needs.version.outputs.version}}.zip
token: ${{ secrets.GITHUB_TOKEN }}
Discord:
runs-on: ubuntu-latest
needs: [prerelease, version]
Expand All @@ -126,15 +103,15 @@ jobs:
nodetail: true
description: |
Version `TBS-${{needs.version.outputs.version}}`
Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download!
**Changelog**:
${{needs.version.outputs.changelog}}
Click [here](https://github.com/Erol444/TravianBotSharp/releases/tag/${{needs.version.outputs.version}}) to download
Clear:
runs-on: ubuntu-latest
needs: prerelease
strategy:
matrix:
server: [TRAVIAN_OFFICIAL, TRAVIAN_OFFICIAL_HEROUI, TTWARS]
steps:
- name: Delete artifact
uses: geekyeggo/delete-artifact@v1
with:
name: TBS-prerelease
name: TBS-${{ matrix.server }}
Loading

0 comments on commit 9988879

Please sign in to comment.