Skip to content

hopefully it'll do vouchers and swindlesreturn during escherion now i… #4340

hopefully it'll do vouchers and swindlesreturn during escherion now i…

hopefully it'll do vouchers and swindlesreturn during escherion now i… #4340

# name: Run Auto Generate JSON with C# File
# # === Workflow Trigger ===
# on:
# push:
# branches:
# - main
# - master
# - Skua
# - dev
# - 'feature/*'
# # === Job Definition ===
# jobs:
# run-csharp-file:
# runs-on: ubuntu-latest # The job will run on the latest version of Ubuntu
# steps:
# # === Step: Checkout Code ===
# - name: Checkout code
# uses: actions/[email protected] # Checks out the repository code
# # === Step: Cache NuGet Packages ===
# - name: Cache NuGet packages
# uses: actions/[email protected] # Caches NuGet packages to speed up builds
# with:
# path: ~/.nuget/packages # Path to the NuGet package cache
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.cs') }} # Cache key based on OS and project files
# restore-keys: |
# ${{ runner.os }}-nuget- # Restore keys for cache
# # === Step: Setup .NET ===
# - name: Setup .NET Core SDK
# uses: actions/[email protected] # Sets up the .NET environment
# with:
# dotnet-version: '6.0.x' # Specifies the .NET version to use
# # === Step: Build the Project ===
# - name: Build the project
# run: dotnet build --configuration Release SkuaScriptsGenerator/SkuaScriptsGenerator.csproj # Builds the project in Release mode
# # === Step: Run C# File ===
# - name: Run C# file
# run: dotnet run --project SkuaScriptsGenerator/SkuaScriptsGenerator.csproj > scripts.json # Runs the C# program and outputs to scripts.json
# # === Step: Upload Artifact ===
# - name: Upload artifact
# uses: actions/[email protected] # Uploads the generated artifact
# with:
# name: scripts-${{ github.run_id }}.json # Names the artifact with the run ID for uniqueness
# path: scripts.json # Path to the file to upload
# retention-days: 30 # Keeps the artifact for 30 days
# # === Step: Commit and Push Changes ===
# - name: Git Auto Commit
# uses: stefanzweifel/[email protected]
# with:
# commit_message: 'Automatic commit by GitHub Actions' # Custom commit message
# file_pattern: 'scripts.json' # File(s) to include in the commit
# push_options: '--force' # Force push to override remote changes
# branch: '${{ github.ref_name }}' # Dynamically use the current branch
# skip_dirty_check: true # Skip the dirty check to always commit
# old ^^
name: Run Auto Generate JSON with C# File
# === Workflow Triggers ===
on:
push:
branches:
- main
- master
- Skua
- dev
- 'feature/*'
# === Job Definition ===
jobs:
run-csharp-file:
runs-on: ubuntu-latest
steps:
# === Step: Checkout Code ===
- name: Checkout code
uses: actions/[email protected]
# === Step: Cache NuGet Packages ===
- name: Cache NuGet packages
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.cs') }}
restore-keys: |
${{ runner.os }}-nuget-
# === Step: Setup .NET ===
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: '6.0.x'
# === Step: Build the Project ===
- name: Build the project
run: dotnet build --configuration Release SkuaScriptsGenerator/SkuaScriptsGenerator.csproj
# === Step: Run C# File ===
- name: Run C# file
run: dotnet run --project SkuaScriptsGenerator/SkuaScriptsGenerator.csproj > scripts.json
# === Step: Upload Artifact (only if changes are detected) ===
- name: Upload artifact
uses: actions/[email protected]
with:
name: scripts-${{ github.run_id }}.json
path: scripts.json
retention-days: 60
# === Step: Commit and Push Changes (only if changes are detected) ===
- name: Git Auto Commit
uses: stefanzweifel/[email protected]
with:
commit_message: 'Automatic commit by GitHub Actions'
file_pattern: 'scripts.json'
push_options: '--force'
branch: '${{ github.ref_name }}'