Skip to content

Commit

Permalink
Merge pull request #23 from XanatosX/develop
Browse files Browse the repository at this point in the history
Update master Release 1.0.1
  • Loading branch information
XanatosX authored Jan 25, 2023
2 parents 7283986 + c4b10a0 commit a32f1aa
Show file tree
Hide file tree
Showing 61 changed files with 680 additions and 415 deletions.
74 changes: 72 additions & 2 deletions .github/workflows/create-live-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
RELEASE_NAME: Recent nightly build
APPLICATION_PUBLISH_FOLDER: ./publish
WINDOWS_ARTIFACT_NAME: IL_2_Career_Toolset_windows_x64
WINDOWS_NUGET_ARTIFACT_NAME: IL_2_Career_Toolset_Nuget_windows_x64
RELEASE_ARTIFACT_FOLDER: artifacts
GH_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -59,7 +60,7 @@ jobs:
echo "BUILD_VERSION=${{ GITHUB.REF_NAME }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Publish Application
run: dotnet publish -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} /p:Version=${{ env.BUILD_VERSION }}
run: dotnet publish .\src\IL2CareerToolset\IL2CareerToolset.csproj -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} --self-contained true -p:Version=${{ env.BUILD_VERSION }} -p:PublishSingleFile=true
- name: Cleanup published build
run: rm ${{ env.APPLICATION_PUBLISH_FOLDER }}\*.pdb
- name: Show content for debug
Expand All @@ -76,9 +77,50 @@ jobs:
name: ${{ env.WINDOWS_ARTIFACT_NAME }}
path: ${{ env.APPLICATION_PUBLISH_FOLDER }}
if-no-files-found: error
create-windows-nuget-tool-build:
name: Build nuget tool
needs: ["check-build"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
lfs: true
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Get release version
run: |
# Found at https://github.com/orgs/community/discussions/25713
# Additional env fix found on https://github.com/actions/runner-images/issues/5251
if ( '${{ GITHUB.REF_TYPE }}' -eq 'branch' ) {
echo "BUILD_VERSION=0.0.0" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
else {
echo "BUILD_VERSION=${{ GITHUB.REF_NAME }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Pack application
run: dotnet pack -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=${{ env.BUILD_VERSION }}
- name: Show content for debug
if: ${{ env.DEBUG == 'true' }}
run: ls
- name: Show content which was packed
if: ${{ env.DEBUG == 'true' }}
run: |
cd ./publish
ls
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.WINDOWS_NUGET_ARTIFACT_NAME }}
path: ${{ env.APPLICATION_PUBLISH_FOLDER }}
if-no-files-found: error
upload-release:
name: Upload Artifacts to release
needs: ["create-windows-build"]
needs: ["create-windows-build", "create-windows-nuget-tool-build"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -94,10 +136,38 @@ jobs:
cd ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_ARTIFACT_NAME
zip -r $WINDOWS_ARTIFACT_NAME.zip ./*
mv $WINDOWS_ARTIFACT_NAME.zip ../
rm -rf ./../$WINDOWS_ARTIFACT_NAME
- name: Move nuget tool
run: |
mv ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/IL2CareerToolset*.nupkg ./$RELEASE_ARTIFACT_FOLDER
rm -rf ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/
- name: Display artifacts folder content
if: ${{ env.DEBUG == 'true' }}
run: ls -la $RELEASE_ARTIFACT_FOLDER
- name: Upload artifacts
if: ${{ env.DEBUG == 'false' }}
run: |
gh release upload ${{ GITHUB.REF_NAME }} ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.zip
gh release upload ${{ GITHUB.REF_NAME }} ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.nupkg
upload-nuget-releases:
name: Upload Nuget packages
#if: github.event_name == 'release'
needs: [upload-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ env.WINDOWS_NUGET_ARTIFACT_NAME }}
path: ${{ env.RELEASE_ARTIFACT_FOLDER }}
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
- name: Show content for publishing
if: ${{ env.DEBUG == 'true' }}
run: ls -la ${{ env.RELEASE_ARTIFACT_FOLDER }}
- name: Publish NuGet package
if: ${{ env.DEBUG == 'false' }}
env: # See https://www.techielass.com/github-actions-secrets/
nuget_apikey: ${{ secrets.NUGET_API_KEY }}
run: |
cd ${{ env.RELEASE_ARTIFACT_FOLDER }}
dotnet nuget push *.nupkg --api-key "${{ env.nuget_apikey }}" --source https://api.nuget.org/v3/index.json
53 changes: 44 additions & 9 deletions .github/workflows/create-nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
RELEASE_NAME: Recent nightly build
APPLICATION_PUBLISH_FOLDER: ./publish
WINDOWS_ARTIFACT_NAME: IL_2_Career_Toolset_windows_x64
WINDOWS_NUGET_ARTIFACT_NAME: IL_2_Career_Toolset_Nuget_windows_x64
RELEASE_ARTIFACT_FOLDER: artifacts
GH_TOKEN: ${{ github.token }}

Expand All @@ -22,9 +23,6 @@ jobs:
should-run: ${{ steps.should-run.outputs.should-run }}
steps:
- uses: actions/checkout@v3
if: ${{ env.DEBUG == 'true' }}
- uses: actions/checkout@v3
if: ${{ env.DEBUG == 'false' }}
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
- name: get latest commit and check it
Expand All @@ -35,7 +33,8 @@ jobs:
# @Note: Check the comments on the solution!
run: |
latest=$(git log -n 1 --pretty=format:"%H")
sha=$(git rev-list --after="24 hours" $latest)
# For debug testing remove ${{ env.REF_CHECKOUT_BRANCH }}
sha=$(git rev-list ${{ env.REF_CHECKOUT_BRANCH }} --after="24 hours" $latest)
echo $sha
echo Do the check now
if test -z $sha
Expand All @@ -49,7 +48,7 @@ jobs:
check-build:
name: Check and Test build
# Based on https://stackoverflow.com/questions/59882715/use-environment-variable-in-github-action-if
if: needs.check-for-changes.outputs.should-run == 'true'
if: needs.check-for-changes.outputs.should-run == 'true'
needs: [check-for-changes]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -84,7 +83,7 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Publish Application
run: dotnet publish -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} /p:Version=0.0.0
run: dotnet publish .\src\IL2CareerToolset\IL2CareerToolset.csproj -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} --self-contained true -p:Version=0.0.0 -p:PublishSingleFile=true
- name: Cleanup published build
run: rm ${{ env.APPLICATION_PUBLISH_FOLDER }}\*.pdb
- name: Show content for debug
Expand All @@ -101,10 +100,41 @@ jobs:
name: ${{ env.WINDOWS_ARTIFACT_NAME }}
path: ${{ env.APPLICATION_PUBLISH_FOLDER }}
if-no-files-found: error
create-windows-nuget-tool-build:
name: Build nuget tool
needs: ["check-build"]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
lfs: true
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Pack application
run: dotnet pack -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=0.0.0
- name: Show content for debug
if: ${{ env.DEBUG == 'true' }}
run: ls
- name: Show content which was packed
if: ${{ env.DEBUG == 'true' }}
run: |
cd ./publish
ls
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.WINDOWS_NUGET_ARTIFACT_NAME }}
path: ${{ env.APPLICATION_PUBLISH_FOLDER }}
if-no-files-found: error
create-release:
name: Create GitHub Release
if: needs.check-for-changes.outputs.should-run == 'true'
needs: ["create-windows-build"]
needs: ["create-windows-build", "create-windows-nuget-tool-build"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -120,6 +150,11 @@ jobs:
cd ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_ARTIFACT_NAME
zip -r $WINDOWS_ARTIFACT_NAME.zip ./*
mv $WINDOWS_ARTIFACT_NAME.zip ../
rm -rf ./../$WINDOWS_ARTIFACT_NAME
- name: Move nuget tool
run: |
mv ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/IL2CareerToolset*.nupkg ./$RELEASE_ARTIFACT_FOLDER
rm -rf ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/
- name: display artifacts folder content
if: ${{ env.DEBUG == 'true' }}
run: ls -la $RELEASE_ARTIFACT_FOLDER
Expand All @@ -129,11 +164,11 @@ jobs:
gh release create Develop-${{ GITHUB.RUN_NUMBER }} \
--title "${{ env.RELEASE_NAME }} [${{ GITHUB.RUN_NUMBER }}]" --target ${{ env.REF_CHECKOUT_BRANCH }} \
--generate-notes --prerelease ${parameters} --notes "Recent version of the develop branch, ready for testing" \
-d ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.zip
-d ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.*
- name: Create release and upload artifacts
if: ${{ env.DEBUG == 'false' }}
run: |
gh release create Develop-${{ GITHUB.RUN_NUMBER }} \
--title "${{ env.RELEASE_NAME }} [${{ GITHUB.RUN_NUMBER }}]" --target ${{ env.REF_CHECKOUT_BRANCH }} \
--generate-notes --prerelease ${parameters} --notes "Recent version of the develop branch, ready for testing" \
${{ env.RELEASE_ARTIFACT_FOLDER }}/*.zip
${{ env.RELEASE_ARTIFACT_FOLDER }}/*.*
45 changes: 35 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
# IL 2 Career Toolset

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/2f639adcc2c64220acea31837f5e5d80)](https://www.codacy.com/gh/XanatosX/IL2CarrerReviver/dashboard?utm_source=github.com&utm_medium=referral&utm_content=XanatosX/IL2CarrerReviver&utm_campaign=Badge_Grade)
[![Nightly Develop Build](https://github.com/XanatosX/IL2CarrerReviver/actions/workflows/create-nightly-build.yml/badge.svg?branch=master)](https://github.com/XanatosX/IL2CarrerReviver/actions/workflows/create-nightly-build.yml)
[![Live build](https://github.com/XanatosX/IL2CarrerReviver/actions/workflows/create-live-build.yml/badge.svg)](https://github.com/XanatosX/IL2CarrerReviver/actions/workflows/create-live-build.yml)

**This readme is still WIP I did want to get nighly build's up ASAP**

> :warning: This tool can only be used with the Game `L-2 Sturmovik Great Battles`.
> To get the game please go to the [game website][game_website] or steam.

**This readme is still WIP I did want to get nighly build's up ASAP.**

This tool will provide you different commands to performe on your save file.
One of the major features is to revive a dead pilot by resetting the carreer to the day before
death.

## Warning
## :warning: Warning :warning:

This tool will change, delete and move data in your save file around, which can corrupt it.
This can lead to unwanted behaviors of the game or make the save useless.
Those errors could appear later and may be invisible directly after usage.
Command's which change your save file will present you a warning you need to comfirm before the
This can lead to unwanted behaviors of the game or break the save completly,
which will affec all other careers as well.
Those errors could appear later on and may be invisible directly after usage.

> :warning: Since I do not play in multiplayer I have no clue if editing the database will cause any errors with the
servers you play on. I would guess that this is not the case but I'm not able to confirm it just yet.

> :information_source: Command's which change your save file will present you a warning you need to comfirm before the
command will run.

## Installation

To install the tool head over to the [releases] or use the [latest release][latest_release].
Download the asset containing the tool, which is a zip file. As soon as the tool is downloaded unzip it
to a folder on your computer.

Continue with the Command list section

## Command list

You need to open a cmd or powershell to run the commands, to do so press windows key and search for
You need to open a `command line` or `powershell` to run the commands, to do so press windows key and search for
powershell or cmd. Navigate to the folder contaning the exe of the toolset by `cd {Folder name you extracted the zip to}`.
Use the commands listed below to use the tool

If you need any additional information or need help with the usage please create a [issue][issues].

### Settings

#### Set Log level
Expand Down Expand Up @@ -72,7 +94,7 @@ This command will list all the pilots of all your save games. there are some pos

| Flag | Description |
| ------------ | ----------------------- |
| -p|--player | Only show player pilots |
| -p\|--player | Only show player pilots |

#### Revive Pilots

Expand All @@ -86,7 +108,7 @@ if it was successful.

| Flag | Description |
| ------------- | --------------------------- |
| -i|--ironman | Include iron man characters |
| -i\|--ironman | Include iron man characters |

### Backup

Expand Down Expand Up @@ -127,7 +149,7 @@ Delete a single backup or all of them, if no arguments provided the program will

| Flag | Description |
| -------- | ----------------------------------- |
| -a|--all | Delete all the backups for the game |
| -a\|--all | Delete all the backups for the game |

#### Rename Backup's

Expand Down Expand Up @@ -166,5 +188,8 @@ Go to [issues] to report any bugs you encounter.

Read the [license] file for more information

[releases]: https://github.com/XanatosX/IL2CarrerReviver/releases
[latest_release]: https://github.com/XanatosX/IL2CarrerReviver/releases/latest
[license]: LICENSE
[issues]: https://github.com/XanatosX/IL2CarrerReviver/issues
[issues]: https://github.com/XanatosX/IL2CarrerReviver/issues
[game_website]: https://il2sturmovik.com/
3 changes: 3 additions & 0 deletions README_Model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# XanatosX.IL2Career.DatabaseAccess

This readme is a stub!
34 changes: 0 additions & 34 deletions src/IL2CareerModel/Data/Gateways/CareerGateway.cs

This file was deleted.

19 changes: 7 additions & 12 deletions src/IL2CareerModel/Data/Gateways/ICareerGateway.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using IL2CarrerReviverModel.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IL2CareerModel.Data.Gateways;
using IL2CarrerReviverModel.Models;

namespace IL2CarrerReviverModel.Data.Gateways;
public interface ICareerGateway
{
IEnumerable<Career> GetAll();

Career? GetById(long id);

Career? Update(Career career);
/// <summary>
/// The gateway to change the career table on the database
/// </summary>
public interface ICareerGateway : IReadGateway<Career>, IWriteGateway<Career>
{
}
Loading

0 comments on commit a32f1aa

Please sign in to comment.