From 18d1e5d0a8864b7bf3ae55bc48e2c6ba9c311261 Mon Sep 17 00:00:00 2001 From: mymobanty Date: Wed, 11 Feb 2026 11:16:19 -0800 Subject: [PATCH 1/7] build json generation pipeline --- .github/scripts/run-pipeline.sh | 39 +++++++++++++++++++++++++ .github/workflows/generate-artifact.yml | 34 +++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/scripts/run-pipeline.sh create mode 100644 .github/workflows/generate-artifact.yml diff --git a/.github/scripts/run-pipeline.sh b/.github/scripts/run-pipeline.sh new file mode 100644 index 0000000..7852a3b --- /dev/null +++ b/.github/scripts/run-pipeline.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +java -jar json-generation-pipeline/tools/saxon.jar \ + -xsl:json-generation-pipeline/transformation-xslt/nbc-to-canonical.xsl \ + -s:json-generation-pipeline/source/nbc-2020-xml/nbc2020.xml \ + -o:json-generation-pipeline/output/nbc-canonical.xml + + +java -jar json-generation-pipeline/tools/saxon.jar \ + -xsl:json-generation-pipeline/transformation-xslt/combine-amendments.xsl \ + -s:json-generation-pipeline/source/bc-amendments/amendment-list.xml \ + -o:json-generation-pipeline/output/bc-amendments-combined.xml + + +java -jar json-generation-pipeline/tools/saxon.jar \ + -xsl:json-generation-pipeline/transformation-xslt/merge-engine-v3.xsl \ + -s:json-generation-pipeline/output/nbc-canonical.xml \ + overlay-document=json-generation-pipeline/output/bc-amendments-combined.xml \ + -o:json-generation-pipeline/output/bc-building-code.xml + + +java -jar json-generation-pipeline/tools/saxon.jar \ + -xsl:json-generation-pipeline/transformation-xslt/combine-amendments.xsl \ + -s:json-generation-pipeline/source/bc-revisions/revision-list.xml \ + -o:json-generation-pipeline/output/bc-revisions-combined.xml + + +java -jar json-generation-pipeline/tools/saxon.jar \ + -xsl:json-generation-pipeline/transformation-xslt/merge-engine-v3.xsl \ + -s:json-generation-pipeline/output/bc-building-code.xml \ + overlay-document=json-generation-pipeline/output/bc-revisions-combined.xml \ + -o:json-generation-pipeline/output/bc-building-code-final.xml + + +java -jar json-generation-pipeline/tools/saxon.jar \ + -xsl:json-generation-pipeline/transformation-xslt/canonical-to-json.xsl \ + -s:json-generation-pipeline/output/bc-building-code-final.xml \ + -o:json-generation-pipeline/output/bcbc-2024.json diff --git a/.github/workflows/generate-artifact.yml b/.github/workflows/generate-artifact.yml new file mode 100644 index 0000000..6566b7b --- /dev/null +++ b/.github/workflows/generate-artifact.yml @@ -0,0 +1,34 @@ +name: Generate BC Building Code Artifact + +on: + workflow_dispatch: {} + +jobs: + build: + # Allow run only when the workflow is dispatched from the specific branch + if: ${{ github.ref == 'refs/heads/feature/IC2026-19_syncrepo2repo' }} + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Run transformation pipeline + run: bash ../scripts/run-pipeline.sh + + + - name: Upload combined artifact + uses: actions/upload-artifact@v4 + with: + name: bc-building-code-artifact + path: | + json-generation-pipeline/output/** + bc-graphics/** + graphics/** From 34d46f8bd123f526dc0a0f04677993201f88115d Mon Sep 17 00:00:00 2001 From: mymobanty Date: Wed, 11 Feb 2026 11:18:58 -0800 Subject: [PATCH 2/7] build pipeline fix --- .github/workflows/generate-artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-artifact.yml b/.github/workflows/generate-artifact.yml index 6566b7b..9f7be9b 100644 --- a/.github/workflows/generate-artifact.yml +++ b/.github/workflows/generate-artifact.yml @@ -5,7 +5,7 @@ on: jobs: build: - # Allow run only when the workflow is dispatched from the specific branch + # Allow run only when the workflow is dispatched from a branch if: ${{ github.ref == 'refs/heads/feature/IC2026-19_syncrepo2repo' }} runs-on: ubuntu-latest From 166d5b50286900ac297a9bf0c123f718dbb100e4 Mon Sep 17 00:00:00 2001 From: mymobanty Date: Wed, 11 Feb 2026 11:21:58 -0800 Subject: [PATCH 3/7] build pipeline fix --- .github/workflows/generate-artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-artifact.yml b/.github/workflows/generate-artifact.yml index 9f7be9b..0e55564 100644 --- a/.github/workflows/generate-artifact.yml +++ b/.github/workflows/generate-artifact.yml @@ -21,7 +21,7 @@ jobs: java-version: '17' - name: Run transformation pipeline - run: bash ../scripts/run-pipeline.sh + run: bash .github/scripts/run-pipeline.sh - name: Upload combined artifact From cbd78c370a42a08d5aba48fffc6635f07c20ae24 Mon Sep 17 00:00:00 2001 From: mymobanty Date: Wed, 11 Feb 2026 12:16:20 -0800 Subject: [PATCH 4/7] fixing overlay build path error --- .github/scripts/run-pipeline.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/scripts/run-pipeline.sh b/.github/scripts/run-pipeline.sh index 7852a3b..4134a0a 100644 --- a/.github/scripts/run-pipeline.sh +++ b/.github/scripts/run-pipeline.sh @@ -1,39 +1,49 @@ #!/usr/bin/env bash set -euo pipefail +ROOT="$(pwd)" +AMENDMENTS_FILE="$ROOT/json-generation-pipeline/output/bc-amendments-combined.xml" +REVISIONS_FILE="$ROOT/json-generation-pipeline/output/bc-revisions-combined.xml" + +# 1. nbc → canonical java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/nbc-to-canonical.xsl \ -s:json-generation-pipeline/source/nbc-2020-xml/nbc2020.xml \ -o:json-generation-pipeline/output/nbc-canonical.xml +# 2. combine amendments java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/combine-amendments.xsl \ -s:json-generation-pipeline/source/bc-amendments/amendment-list.xml \ -o:json-generation-pipeline/output/bc-amendments-combined.xml +# 3. merge canonical + amendments (absolute URI) java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/merge-engine-v3.xsl \ -s:json-generation-pipeline/output/nbc-canonical.xml \ - overlay-document=json-generation-pipeline/output/bc-amendments-combined.xml \ + overlay-document="file://$AMENDMENTS_FILE" \ -o:json-generation-pipeline/output/bc-building-code.xml +# 4. combine revisions java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/combine-amendments.xsl \ -s:json-generation-pipeline/source/bc-revisions/revision-list.xml \ -o:json-generation-pipeline/output/bc-revisions-combined.xml +# 5. merge building-code + revisions (absolute URI) java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/merge-engine-v3.xsl \ -s:json-generation-pipeline/output/bc-building-code.xml \ - overlay-document=json-generation-pipeline/output/bc-revisions-combined.xml \ + overlay-document="file://$REVISIONS_FILE" \ -o:json-generation-pipeline/output/bc-building-code-final.xml +# 6. canonical → JSON java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/canonical-to-json.xsl \ -s:json-generation-pipeline/output/bc-building-code-final.xml \ - -o:json-generation-pipeline/output/bcbc-2024.json + -o:json-generation-pipeline/output/bc-building-code.json \ No newline at end of file From 94888e3f1b87562e68e502d3430033589b57d42f Mon Sep 17 00:00:00 2001 From: mymobanty Date: Wed, 11 Feb 2026 13:30:42 -0800 Subject: [PATCH 5/7] fix name to bcbc-2024.json --- .github/scripts/run-pipeline.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/scripts/run-pipeline.sh b/.github/scripts/run-pipeline.sh index 4134a0a..7e25fed 100644 --- a/.github/scripts/run-pipeline.sh +++ b/.github/scripts/run-pipeline.sh @@ -5,21 +5,19 @@ ROOT="$(pwd)" AMENDMENTS_FILE="$ROOT/json-generation-pipeline/output/bc-amendments-combined.xml" REVISIONS_FILE="$ROOT/json-generation-pipeline/output/bc-revisions-combined.xml" -# 1. nbc → canonical + java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/nbc-to-canonical.xsl \ -s:json-generation-pipeline/source/nbc-2020-xml/nbc2020.xml \ -o:json-generation-pipeline/output/nbc-canonical.xml -# 2. combine amendments java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/combine-amendments.xsl \ -s:json-generation-pipeline/source/bc-amendments/amendment-list.xml \ -o:json-generation-pipeline/output/bc-amendments-combined.xml -# 3. merge canonical + amendments (absolute URI) java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/merge-engine-v3.xsl \ -s:json-generation-pipeline/output/nbc-canonical.xml \ @@ -27,14 +25,12 @@ java -jar json-generation-pipeline/tools/saxon.jar \ -o:json-generation-pipeline/output/bc-building-code.xml -# 4. combine revisions java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/combine-amendments.xsl \ -s:json-generation-pipeline/source/bc-revisions/revision-list.xml \ -o:json-generation-pipeline/output/bc-revisions-combined.xml -# 5. merge building-code + revisions (absolute URI) java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/merge-engine-v3.xsl \ -s:json-generation-pipeline/output/bc-building-code.xml \ @@ -42,8 +38,7 @@ java -jar json-generation-pipeline/tools/saxon.jar \ -o:json-generation-pipeline/output/bc-building-code-final.xml -# 6. canonical → JSON java -jar json-generation-pipeline/tools/saxon.jar \ -xsl:json-generation-pipeline/transformation-xslt/canonical-to-json.xsl \ -s:json-generation-pipeline/output/bc-building-code-final.xml \ - -o:json-generation-pipeline/output/bc-building-code.json \ No newline at end of file + -o:json-generation-pipeline/output/bcbc-2024.json \ No newline at end of file From 8136e6ff1c662ca43d14d992a177e307c24778ad Mon Sep 17 00:00:00 2001 From: mymobanty Date: Wed, 11 Feb 2026 16:41:45 -0800 Subject: [PATCH 6/7] workflow auth set --- .github/workflows/generate-artifact.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/generate-artifact.yml b/.github/workflows/generate-artifact.yml index 0e55564..0eb1ca8 100644 --- a/.github/workflows/generate-artifact.yml +++ b/.github/workflows/generate-artifact.yml @@ -32,3 +32,12 @@ jobs: json-generation-pipeline/output/** bc-graphics/** graphics/** + + - name: Trigger Repo B sync + if: success() + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.REPO_B_TRIGGER_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/bcgov/HOUS-Interactive-BCBC/dispatches \ + -d "{\"event_type\":\"sync-from-repo-a\",\"client_payload\":{\"branch\":\"${GITHUB_REF_NAME}\"}}" From 7986db2276024ee4bebb2fc1b00c760bce3d7e18 Mon Sep 17 00:00:00 2001 From: mymobanty Date: Thu, 19 Feb 2026 08:53:01 -0800 Subject: [PATCH 7/7] changed branch to dev --- .github/workflows/generate-artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-artifact.yml b/.github/workflows/generate-artifact.yml index 0eb1ca8..c714394 100644 --- a/.github/workflows/generate-artifact.yml +++ b/.github/workflows/generate-artifact.yml @@ -6,7 +6,7 @@ on: jobs: build: # Allow run only when the workflow is dispatched from a branch - if: ${{ github.ref == 'refs/heads/feature/IC2026-19_syncrepo2repo' }} + if: ${{ github.ref == 'refs/heads/develop' }} runs-on: ubuntu-latest