Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dcdca19
ci(dev): gitguardian ref removed
Phil-NHS May 1, 2025
2a208e8
ci(checks): from dev yml to check yml
Phil-NHS May 1, 2025
ea6e0f0
ci(commitlint): test
Phil-NHS May 1, 2025
847cee8
ci(gogh): vcbcv
Phil-NHS May 1, 2025
b7f6a4e
ci(cicd): editmsg
Phil-NHS May 1, 2025
17b4018
ci(prehooks): local global precommit and prepush commitlint
Phil-NHS May 2, 2025
1427209
ci(dev.yml): needs reuseable workflow
Phil-NHS May 2, 2025
4d5f6ec
ci(reuseable ci): indentation
Phil-NHS May 2, 2025
3e3430d
ci(dev fallback if not git tag yet): need package token on repo too
Phil-NHS May 2, 2025
22836ea
ci(dev.yml): org nugetkey token for packagestoken
Phil-NHS May 2, 2025
764f616
ci(dev.yml): correct showcase proj name
Phil-NHS May 2, 2025
6ffaa27
ci(nuget package name): Changed package name
Phil-NHS May 2, 2025
21c2476
ci(dev): csproj name
Phil-NHS May 2, 2025
84a3b7b
ci(dev): csproj route
Phil-NHS May 2, 2025
c64cfe3
ci(wasmstatic): publish route
Phil-NHS May 2, 2025
ef97692
ci(dev.yml): set artifact url to env
Phil-NHS May 2, 2025
f9a431e
ci(dev): get artifact location job order
Phil-NHS May 2, 2025
0655ce6
ci(wasm static proj): flatten wwwroot for gh-pages
Phil-NHS May 2, 2025
648d09a
ci(reuseable ci checks): build check
Phil-NHS May 2, 2025
053ca8e
ci(reuseable): build steps added
Phil-NHS May 2, 2025
473cb33
ci(reusuable-ci): script fail test
Phil-NHS May 2, 2025
ba7a2b6
ci(reuseable): not getting error should have
Phil-NHS May 2, 2025
22c1766
ci(reuseable-ci-checks): not working
Phil-NHS May 2, 2025
1bbf550
ci(reuseable): removed deliberate error
Phil-NHS May 2, 2025
0c6d40f
ci(release): first go to pr then master
Phil-NHS May 2, 2025
6e0c7cd
ci(reuseable-ci-checks): make useable in branch checks
Phil-NHS May 6, 2025
ca70f75
ci(reuseable): make needs correct ref
Phil-NHS May 6, 2025
aa5e6de
ci(reusueable): naming
Phil-NHS May 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 39 additions & 129 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

# Permission
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
PACKAGES_TOKEN: ${{ secrets.NUGETKEY }}
GITHUB_USERNAME: "Phil-NHS"

# Nuget Set Up
Expand All @@ -22,96 +22,24 @@ env:

# Build Set Up
USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE: false



DISABLE_PACKAGE_GENERATION: false

jobs:
#qqqq put back in

call-reusable-ci-checks-workflow:
name: run ci checks
uses: ./.github/workflows/reuseable-ci-checks.yml
with:
runall: true

branch-name-check:
name: Enforce Branch Name Convention
if: success() || failure()
runs-on: ubuntu-latest
steps:
- name: Validate Branch Name
run: |
#BRANCH_NAME="${GITHUB_HEAD_REF}"
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
echo "Validating branch name: $BRANCH_NAME"

if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]]; then
echo "✅ Branch name is valid"
else
echo "❌ Invalid branch name: $BRANCH_NAME"
echo "Branch names must follow one of the allowed prefixes:"
echo " build-*, feat-*, fix-*, bugfix-*, hotfix-*, build-*, chore-*, ci-*, docs-*, perf-*, refactor-*, revert-*, style-*, test-*, sample-*, security-*, config-*, bugfix-*, hotfix-*"
exit 1
fi
continue-on-error: false

commitlint:
runs-on: ubuntu-latest
if: success() || failure()
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
with:
configFile: .commitlintrc.json
continue-on-error: false

# Global and better as prehook
# gitguardian-scan:
# runs-on: ubuntu-latest
# if: success() || failure()
# steps:
# - uses: actions/checkout@v3

# - name: GitGuardian Scan
# uses: GitGuardian/gg-shield-action@v1
# env:
# GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
# continue-on-error: false

Unit-Tests:
runs-on: ubuntu-latest
if: success() || failure()
steps:
- name: See other project pipeline for Tests
run: echo " See other project pipeline for Tests this is a placeholder"
continue-on-error: false


E2E-Tests:
runs-on: ubuntu-latest
if: success() || failure()
steps:
- name: See other project pipeline for Tests
run: echo " See other project pipeline for Tests this is a placeholder"
continue-on-error: false

Code-Coverage:
runs-on: ubuntu-latest
if: success() || failure()
steps:
- name: See other project pipeline for Tests
run: echo " See other project pipeline for Tests this is a placeholder"
continue-on-error: false

# Now we've done due diligence
# The checks have been allowed to run if the workflow fails so if there a multiple fails we know.
# We do not proceed from the point if there is a fail.
# Hence explicit "if" and "needs"
generate-dev-semantic-version:
if: success()
needs: [commitlint, gitguardian-scan, Unit-Tests, E2E-Tests, Code-Coverage, branch-name-check]
needs: [call-reusable-ci-checks-workflow]
runs-on: ubuntu-latest
outputs:
dev-package-version: ${{ steps.set-dev-semantic-version.outputs.dev-semantic-version }}
Expand All @@ -124,10 +52,6 @@ jobs:


- name: Install Semantic Release Packages
#qqqq shouldnt need
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
run: |
echo "Installing semantic-release packages..."
npm install -D \
Expand All @@ -144,10 +68,6 @@ jobs:


- name: Run Semantic Version (None Blocking)
# remove if not needed qqqq
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
run: |
# If no version is required we can get an error so here we handle it
set +e
Expand All @@ -169,6 +89,11 @@ jobs:
# This tag may not belong to the current branch, so the result isn't guaranteed to reflect the latest changes on this branch.
echo "Semver fallback: using latest Git tag, which may not be from the current branch."
fi

if [ -z "$SEMVER_OUTPUT" ]; then
SEMVER_OUTPUT="0.0.0"
echo "No semantic version or tag, defaulting to 0.0.0 $SEMVER_OUTPUT"
fi

# Export the result to the environment
echo "SEMVER_OUTPUT=$SEMVER_OUTPUT" >> $GITHUB_ENV
Expand All @@ -193,7 +118,7 @@ jobs:

build-telblazor-dev-package-and-publish:
if: success()
needs: [generate-dev-semantic-version, commitlint, Unit-Tests,E2E-Tests, Code-Coverage, branch-name-check]
needs: [generate-dev-semantic-version, call-reusable-ci-checks-workflow]
runs-on: ubuntu-latest
env:
DEV_TELBLAZOR_PACKAGE_VERSION: ${{ needs.generate-dev-semantic-version.outputs.dev-package-version }}
Expand Down Expand Up @@ -226,12 +151,15 @@ jobs:
run: npm ci
#CI is an install that adheres to package-lock

- name: Build BlazorComponentLibrary (it publishes on build)
- name: Build TELBlazor.Components (it publishes on build)
env:
DISABLE_PACKAGE_GENERATION: false
run: |
dotnet build Package.BlazorComponentLibrary -c Release \
dotnet build TELBlazor.Components -c Release \
/p:TELBlazorPackageVersion=$DEV_TELBLAZOR_PACKAGE_VERSION \
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
/p:DisablePackageGeneration=$DISABLE_PACKAGE_GENERATION

- name: Publish to TechnologyEnhancedLearning as a Dev Package
run: |
Expand All @@ -245,12 +173,11 @@ jobs:
Make-WasmStaticClient-DevShowCase-Artifact-Trigger-GH-Pages-In-TELBlazor-DevShowCase-Repo:

if: success() #not needed but being explicit
needs: [ branch-name-check, build-telblazor-dev-package-and-publish,generate-dev-semantic-version, commitlint, gitguardian-scan, Unit-Tests, E2E-Tests]
needs: [build-telblazor-dev-package-and-publish, generate-dev-semantic-version, call-reusable-ci-checks-workflow]
runs-on: ubuntu-latest
env:
DEV_TELBLAZOR_PACKAGE_VERSION: ${{ needs.generate-dev-semantic-version.outputs.dev-package-version }}


steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -289,64 +216,47 @@ jobs:


#qqqq with recent changes can we just build the solution now if this works then check
- name: Build Shared Pages
run: |
dotnet build SharedPages -c Release \
/p:TELBlazorPackageVersion=$DEV_TELBLAZOR_PACKAGE_VERSION \
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
/p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE
# /p:GhPageRelease=false \ qqqq is it still a thing?




# qqqq no longer needed
# Hardcoding here the INDEPENDENT_CLIENT_GH_PAGES value
# - name: Modify appsettings.json with hardcoded value
# - name: Build TELBlazor.Components.ShowCase.Shared
# run: |
# jq '.INDEPENDENT_CLIENT_GH_PAGES = "true"' TestHostPrerenderWASM/TestHostPrerenderWASM.Client/wwwroot/appsettings.json > tmp.json && mv tmp.json TestHostPrerenderWASM/TestHostPrerenderWASM.Client/wwwroot/appsettings.json
# # Print the contents of appsettings.json inside 'TestHostPrerenderWASM.Client' folder
# - name: Display appsettings.json content
# run: cat TestHostPrerenderWASM/TestHostPrerenderWASM.Client/wwwroot/appsettings.json
# dotnet build TELBlazor.Components.ShowCase.Shared -c Release \
# /p:TELBlazorPackageVersion=$DEV_TELBLAZOR_PACKAGE_VERSION \
# /p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
# /p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
# /p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE


- name: Publish WasmStaticClient
run: |
dotnet publish ./TELBlazor/TELBlazor.Components.ShowCase.WasmStaticClient/TELBlazor.Components.ShowCase.WasmStaticClient.csproj --configuration Release \
dotnet publish ./TELBlazor.Components.ShowCase.WasmStaticClient/TELBlazor.Components.ShowCase.WasmStaticClient.csproj --configuration Release \
/p:TELBlazorPackageVersion=$DEV_TELBLAZOR_PACKAGE_VERSION \
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
/p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE
# qqqq no longer needed /p:GhPageRelease=true \


# - name: Debug - List all files in docs folder qqqq
# run: |
# echo "Listing contents of ./docs directory"
# ls -alh ./docs
# echo "Listing contents of ./docs/wwwroot directory"
# ls -alh ./docs/wwwroot || echo "wwwroot directory not found"
# echo "Checking for bclversion.txt in ./docs"
# if [ -f "./docs/bclversion.txt" ]; then
# echo "Contents of ./docs/bclversion.txt:"
# cat ./docs/bclversion.txt
# else
# echo "bclversion.txt not found in ./docs"
# fi



#include hidden so we get jekyll
- name: Creating artifact of publish folder for test gh page workflow
uses: actions/upload-artifact@v4
with:
name: gh-blazor-components-wiki-site-using-package-${{env.DEV_TELBLAZOR_PACKAGE_VERSION}}
name: published-telblazor-components-showcase-wasmstaticclient-using-dev-package-${{env.DEV_TELBLAZOR_PACKAGE_VERSION}}
include-hidden-files: true
path: |
./docs
./docs/.nojekyll # explicitly include the .nojekyll file
retention-days: 90

- name: Get artifact location
run: |
# Get the artifact list for the current workflow run
ARTIFACT_LIST=$(gh api "repos/TechnologyEnhancedLearning/TELBlazor/actions/runs/${GITHUB_RUN_ID}/artifacts")
# Echo the entire artifact list for debugging purposes
echo "Artifact List: $ARTIFACT_LIST"
# Extract the download URL from the artifact list (first artifact in the list)
#ARTIFACT_URL=$(echo "$ARTIFACT_LIST" | jq -r '.artifacts[0].archive_download_url')
ARTIFACT_URL=$(echo "$ARTIFACT_LIST" | jq -r '.artifacts[0].url')
# Echo the artifact URL to confirm
echo "Artifact URL: $ARTIFACT_URL"
echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_ENV

- name: Trigger Workflow in TELBlazor-DevShowCase Repository
run: |
repo_owner="TechnologyEnhancedLearning"
Expand Down
50 changes: 18 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ permissions:

env:


# Permission
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
PACKAGES_TOKEN: ${{ secrets.NUGETKEY }}
GITHUB_USERNAME: "Phil-NHS"

# Nuget Set Up
Expand All @@ -22,7 +21,7 @@ env:

# Build Set Up
USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE: false

DISABLE_PACKAGE_GENERATION: false

jobs:
generate-semantic-version:
Expand All @@ -36,10 +35,6 @@ jobs:
fetch-depth: 0 # required for semantic release to analyze commit history

- name: Install Semantic Release Packages
# qqqq shouldnt need
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
run: |
echo "Installing semantic-release packages..."
npm install -D \
Expand All @@ -52,22 +47,11 @@ jobs:
echo "Semantic Release packages installed."
npm ls --depth=0 # Debug: List installed packages

#qqqq
# - name: Debug Git Remote Branches
# run: git remote show origin

# - name: Check Existing Tags
# run: |
# echo "Checking existing tags..."
# git fetch --tags
# git tag -l # List all tags to see if there are any conflicts

##configured with .releaseseec

#configured with .releaseseec
- name: run semantic release
id: set-semantic-version
# should need qqqq
# env:
# github_token: ${{ secrets.github_token }}
run: |
set +e
SEMVER_VERSION=$(npx semantic-release | grep -oP 'Published release \K[\d.]+')
Expand Down Expand Up @@ -118,16 +102,17 @@ jobs:
node-version: '20'

- name: Install npm packages so we have gulp for retrieving TEL Frontend Css
working-directory: ./Package.BlazorComponentLibrary
working-directory: ./TELBlazor.Components
run: npm ci
#CI is an install with adhering to package-lock

- name: Build and Pack BlazorComponentLibrary
run: |
dotnet build Package.BlazorComponentLibrary -c Release \
/p:TELBlazorPackageVersion=$TELBLAZOR_PACKAGE_VERSION \
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH

/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
/p:DisablePackageGeneration=$DISABLE_PACKAGE_GENERATION

- name: Publish to TechnologyEnhancedLearning Package
run: |
Expand Down Expand Up @@ -173,19 +158,20 @@ jobs:

echo "Listing packages.lock.json files:"
find . -name "packages.lock.json" -type f -print

- name: Build Shared Pages
run: |
dotnet build SharedPages -c Release \
/p:TELBlazorPackageVersion=$TELBLAZOR_PACKAGE_VERSION \
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
/p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE

#qqqq do we need this can we not build the package, then build the project with package build false or just build the package then the wasm proje
# - name: Build TELBlazor.Components.ShowCase.Shared
# run: |
# dotnet build TELBlazor.Components.ShowCase.Shared -c Release \
# /p:TELBlazorPackageVersion=$TELBLAZOR_PACKAGE_VERSION \
# /p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
# /p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
# /p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE


- name: Publish WasmStaticClient
run: |
dotnet publish ./TELBlazor/TELBlazor.Components.ShowCase.WasmStaticClient/TELBlazor.Components.ShowCase.WasmStaticClient.csproj --configuration Release \
dotnet publish ./TELBlazor.Components.ShowCase.WasmStaticClient/TELBlazor.Components.ShowCase.WasmStaticClient.csproj --configuration Release \
/p:TELBlazorPackageVersion=$TELBLAZOR_PACKAGE_VERSION \
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
Expand Down
Loading
Loading