Allow reverse proxies to pass forwarded headers allowing for api acce… #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Intersect (main) | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- '.github/**' | |
workflow_dispatch: | |
inputs: | |
forceBuild: | |
description: 'If the build should be forced even on cache hit' | |
default: false | |
type: boolean | |
forceRestore: | |
description: 'If dependencies should be forced even on cache hit' | |
default: false | |
type: boolean | |
workflowDebug: | |
description: 'If the workflow should be debugged (skip release)' | |
default: true | |
type: boolean | |
permissions: | |
contents: write | |
env: | |
VERSION_PREFIX: 0.8.0 | |
VERSION_SUFFIX: -beta | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache binaries | |
uses: actions/cache@v3 | |
id: cache-binaries | |
with: | |
key: ${{ runner.os }}-binaries-${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}-${{ hashFiles('Intersect*/**/*.cs*') }} | |
path: | | |
Intersect*/bin/Release/**/* | |
- name: Setup dotnet | |
if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Cache NuGet dependencies | |
uses: actions/cache@v3 | |
id: cache-nuget | |
if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true | |
with: | |
key: ${{ runner.os }}-nuget-${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}-${{ hashFiles('Intersect*/*.csproj') }} | |
path: | | |
~/.nuget/packages | |
Intersect*/obj/ | |
- name: Restore NuGet Packages | |
if: steps.cache-binaries.outputs.cache-hit != 'true' && steps.cache-nuget.outputs.cache-hit != 'true' || inputs.forceRestore == true | |
run: dotnet restore Intersect.sln | |
# - run: ls -R ~/.nuget/packages | |
- name: Build solution | |
if: steps.cache-binaries.outputs.cache-hit != 'true' || inputs.forceBuild == true || inputs.forceRestore == true | |
run: | | |
dotnet publish Intersect.sln -r win-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} | |
git apply disable-windows-editor.patch | |
dotnet publish Intersect.sln -r linux-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} | |
dotnet publish Intersect.sln -r osx-x64 -p:Configuration=Release -p:PackageVersion=${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} -p:Version=${{ env.VERSION_PREFIX }}.${{ github.run_number }} | |
# - name: Debug output of Build Solution | |
# run: ls -R | |
- name: Checkout assets main_upgrade branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: assets_upgrade | |
repository: AscensionGameDev/Intersect-Assets | |
ref: main_upgrade | |
token: ${{ secrets.INTERSECTBOT_ACCESS_TOKEN }} | |
- name: Checkout target main_full branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: assets_full | |
repository: AscensionGameDev/Intersect-Assets | |
ref: main_full | |
token: ${{ secrets.INTERSECTBOT_ACCESS_TOKEN }} | |
- name: Package artifacts | |
uses: AscensionGameDev/actions@cc2eb0e356546042e4dc7eca6788fd0b5a063b32 | |
with: | |
bundle: .github/bundles/*.json | |
version: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }}+build.${{ github.sha }} | |
- name: Publish GitHub Release | |
if: inputs.workflowDebug != true | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "dist/**/*.zip" | |
commit: ${{ github.sha }} | |
generateReleaseNotes: true | |
name: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }} | |
prerelease: true | |
tag: v${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }}.${{ github.run_number }} | |
- name: Upload artifacts for workflow debugging | |
if: inputs.workflowDebug == true || failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
name: workflow-debug | |
path: "dist/**/*.zip" | |
publish: | |
if: inputs.workflowDebug != true | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish to Forum | |
uses: AscensionGameDev/actions@0223df40becb110039c705c02cfd2cd8f274199c | |
with: | |
api-key: ${{ secrets.INTERSECTBOT_FORUM_TOKEN }} | |
build: ${{ github.run_number }} | |
hash: ${{ github.sha }} | |
runtime-identifiers: linux-x64,osx-x64,win-x64 | |
topic-id: ${{ vars.INTERSECTBOT_FORUM_TOPIC_ID }} | |
version: ${{ env.VERSION_PREFIX }}${{ env.VERSION_SUFFIX }} |