From b03a22a8e47f36405558828f81bf4bba2454662e Mon Sep 17 00:00:00 2001 From: Gabriel Palma Date: Wed, 28 Aug 2024 08:49:15 +1000 Subject: [PATCH] Added siren-gen and workflow trigger --- .github/workflows/siren-gen.yml | 43 +++++++++++++++++++ .../appsettings.json | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/siren-gen.yml diff --git a/.github/workflows/siren-gen.yml b/.github/workflows/siren-gen.yml new file mode 100644 index 0000000..d908aa9 --- /dev/null +++ b/.github/workflows/siren-gen.yml @@ -0,0 +1,43 @@ +name: siren-gen + +on: + workflow_dispatch: + push: + branches: [ master ] + paths: + - '**/Migrations/**' +jobs: + siren-gen: + runs-on: ubuntu-latest + env: + MAJOR_VERSION: 6 + MINOR_VERSION: 0 + SOLUTION_PATH: ./src/6.0/ + MIGRATION_DLL: Not.Again.Database.Migrations.dll + MARKDOWN_ANCHOR: "# Domain model" + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Install siren-gen tool + run: dotnet tool install -g Gman.Siren + - name: Restore dependencies + run: dotnet restore $SOLUTION_PATH + - name: Build + run: dotnet publish $SOLUTION_PATH --no-restore --ignore-failed-sources -c Release + - name: Create output folder + run: mkdir ./output + - name: Consolidate packages (including symbols) + run: find . -name "*.dll" -type f -exec cp {} ./output \; + - name: Echo packages + run: find ./output -name "*.dll" -type f -exec echo {} \; + - name: Run siren-gen on ModelSnapshot + run: siren-gen "./output/$MIGRATION_DLL" "README.md" "$MARKDOWN_ANCHOR" + - name: Commit README + run: | + git config user.email "info@gman.com.au" + git config user.name "G-MAN Support" + git commit README.md -m "Updated README (siren-gen)" || echo "No changes to commit" + git push origin || echo "No changes to commit" \ No newline at end of file diff --git a/src/6.0/Not.Again.Database.Migrations/appsettings.json b/src/6.0/Not.Again.Database.Migrations/appsettings.json index 4c75229..9cc619c 100644 --- a/src/6.0/Not.Again.Database.Migrations/appsettings.json +++ b/src/6.0/Not.Again.Database.Migrations/appsettings.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "NOT-AGAIN": "Data Source=localhost;Initial Catalog=NOT-AGAIN;Trusted Connection=True" + "NOT-AGAIN": "Initial Catalog=NOT-AGAIN;Data Source=localhost;Trusted Connection=True" } } \ No newline at end of file