Skip to content

Rename to FinolDigital.Cgs.Json and cgs.json #42

Rename to FinolDigital.Cgs.Json and cgs.json

Rename to FinolDigital.Cgs.Json and cgs.json #42

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "main" ]
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.versioning.outputs.version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Version
id: versioning
uses: paulhatch/[email protected]
with:
version_format: "${major}.${minor}.${patch}"
- name: Set VERSION variable from tag
env:
VERSION: ${{ steps.versioning.outputs.version }}
run: echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION}
- name: Upload FinolDigital.Cgs.Json.dll
uses: actions/upload-artifact@v4
with:
name: FinolDigital.Cgs.Json.dll
path: FinolDigital.Cgs.Json/bin/Release/netstandard2.1/FinolDigital.Cgs.Json.dll
- name: Generate schema
run: dotnet SchemaGeneration/bin/Release/net6.0/SchemaGeneration.dll
- name: Copy schema
run: cp cgs.json schema/
- name: Upload cgs.json
uses: actions/upload-artifact@v4
with:
name: cgs.json
path: cgs.json
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION}
- name: Upload nuget package
uses: actions/upload-artifact@v4
with:
name: FinolDigital.Cgs.Json.${{ steps.versioning.outputs.version }}.nupkg
path: FinolDigital.Cgs.Json/bin/Release/FinolDigital.Cgs.Json.${{ steps.versioning.outputs.version }}.nupkg
- name: Update nuget settings
if: github.event.action == 'published'
run: dotnet nuget add source --username [email protected] --password ${{ secrets.CGS_PAT }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/finol-digital/index.json"
- name: Push nuget package
if: github.event.action == 'published'
run: dotnet nuget push "FinolDigital.Cgs.Json/bin/Release/FinolDigital.Cgs.Json.${VERSION}.nupkg" --source "github"
- name: Raise PR for schema
if: github.event.action == 'published'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.CGS_PAT }}
path: schema
branch: cgsjson-${{ needs.build.outputs.version }}
title: Cgs.json ${{ needs.build.outputs.version }}
updateCgs:
name: Update CGS
runs-on: ubuntu-latest
needs: build
if: github.event.action == 'published'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
path: FinolDigital.Cgs.Json
- name: Checkout CGS project
uses: actions/checkout@v4
with:
repository: finol-digital/Card-Game-Simulator
token: ${{ secrets.CGS_PAT }}
path: Card-Game-Simulator
lfs: true
- name: Download FinolDigital.Cgs.Json.dll
uses: actions/download-artifact@v4
with:
name: FinolDigital.Cgs.Json.dll
path: Card-Game-Simulator/Assets/Plugins
- name: Download cgs.json
uses: actions/download-artifact@v4
with:
name: cgs.json
path: Card-Game-Simulator/docs/schema
- name: Raise PR to Card-Game-Simulator
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.CGS_PAT }}
path: Card-Game-Simulator
branch: cgsjson-${{ needs.build.outputs.version }}
title: Cgs.json ${{ needs.build.outputs.version }}