From c23c8539d590df0e5207be5bacd7eae8b8d5d898 Mon Sep 17 00:00:00 2001 From: Nameless <85962933+Misfiy@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:25:35 +0100 Subject: [PATCH 1/3] NOT COMPLETE WORKFLOWS --- .github/workflows/main.yml | 34 +++++++++++++++++++++++++++ .github/workflows/release_handler.yml | 5 ++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release_handler.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4ed525d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: ContentAPI Main CI + +on: + push: + branches: + - master + - dev + pull_request: + branches: + - master + - dev + +env: + CW_REFERENCES_URL: https://CircusStudios.github.io/CW-References/Master.zip + CW_REFERENCES_PATH: ${{ github.workspace }}/ContentWarning/References + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Setup Dotnet + uses: actions/setup-dotnet@v4.0.1 + + - uses: actions/checkout@v4.1.7 + + - name: Get References + shell: pwsh + run: | + Invoke-WebRequest -Uri ${{ env.CW_REFERENCES_URL }} -OutFile ${{ github.workspace }}/ContentWarning/References.zip + Expand-Archive -Path References.zip -DestinationPath ${{ env.CW_REFERENCES_PATH }} + + - name: Build + \ No newline at end of file diff --git a/.github/workflows/release_handler.yml b/.github/workflows/release_handler.yml new file mode 100644 index 0000000..de76c79 --- /dev/null +++ b/.github/workflows/release_handler.yml @@ -0,0 +1,5 @@ +name: ContentAPI Release + +on: + release: + types: [ published, prereleased ] \ No newline at end of file From a75eb2cb3fd1f3daacc78223c771dbf9bddc96dd Mon Sep 17 00:00:00 2001 From: Nameless <85962933+Misfiy@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:36:52 +0100 Subject: [PATCH 2/3] main.yml --- .github/workflows/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ed525d..1cab526 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,4 +31,12 @@ jobs: Expand-Archive -Path References.zip -DestinationPath ${{ env.CW_REFERENCES_PATH }} - name: Build - \ No newline at end of file + env: + CONTENTWARNING_REFERENCES: ${{ env.CW_REFERENCES_PATH }} + run: dotnet build + + - name: Upload artifcats + uses: actions/upload-artifact@v4 + with: + name: Build Results + path: ContentAPI/bin/release \ No newline at end of file From 0c308889119e07567f2c07fa53d235fabb6abe52 Mon Sep 17 00:00:00 2001 From: Nameless <85962933+Misfiy@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:46:24 +0100 Subject: [PATCH 3/3] push_nuget.yml --- .github/workflows/push_nuget.yml | 42 +++++++++++++++++++++++++++ .github/workflows/release_handler.yml | 5 ---- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/push_nuget.yml delete mode 100644 .github/workflows/release_handler.yml diff --git a/.github/workflows/push_nuget.yml b/.github/workflows/push_nuget.yml new file mode 100644 index 0000000..758492f --- /dev/null +++ b/.github/workflows/push_nuget.yml @@ -0,0 +1,42 @@ +name: ContentAPI Release + +on: + release: + types: [ published, prereleased ] + + +env: + CW_REFERENCES_URL: https://CircusStudios.github.io/CW-References/Master.zip + CW_REFERENCES_PATH: ${{ github.workspace }}/ContentWarning/References + +jobs: + push: + runs-on: windows-latest + + steps: + - name: Setup Dotnet + uses: actions/setup-dotnet@v4.0.1 + + - uses: actions/checkout@v4.1.7 + + - name: Get References + shell: pwsh + run: | + Invoke-WebRequest -Uri ${{ CW_REFERENCES_URL }} -OutFile ${{ github.workspace }}/ContentAPI/References.zip + Expand-Archive -Path References.Zip -DestinationPath ${{ env.CW_REFERENCES_PATH }} + + - name: Build Nuget + env: + CW_REFERENCES: ${{ env.CW_REFERENCES_PATH }} + shell: pwsh + run: | + ./build.ps1 -BuildNuGet + $File = (Get-ChildItem -Path . -Include 'ContentAPI.*.nupkg' -Recurse).Name + Out-File -FilePath ${{ github.env }} -InputObject "PackageFile=$File" -Encoding utf-8 -Append + + - name: Push NuGet + shell: pwsh + run: nuget push ${{ env.PackageFile }} -ApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json -SkipDuplicate + + - name: Push generated package to GitHub registry + run: dotnet nuget push ${{ env.PackageFile }} -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/ExMod-Team/index.json --skip-duplicate \ No newline at end of file diff --git a/.github/workflows/release_handler.yml b/.github/workflows/release_handler.yml deleted file mode 100644 index de76c79..0000000 --- a/.github/workflows/release_handler.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: ContentAPI Release - -on: - release: - types: [ published, prereleased ] \ No newline at end of file