Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
286 changes: 5 additions & 281 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Bringing together dev ymls

# TODO could share artifacts between jobs to reduce number of builds
# this should have just been BCLSource %LocalPackagePath% but set locally now
# would have been better with github environments appsetting setting some of program.cs for wasm
name: Dev pipeline for test lint packaging artifact and gh-page trigger
on:
# Trigger the workflow for push and pull requests to all branches except 'main' and 'master'
# Trigger the workflow for push requests to all branches except 'main' and 'master'
push:
branches-ignore:
- 'main'
Expand All @@ -25,7 +25,6 @@ env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
GITHUB_USERNAME: "Phil-NHS"

#DisablePackageGeneration
NUPKG_OUTPUT_PATH: ${{ github.workspace }}/CICDPackageLocation


Expand Down Expand Up @@ -132,7 +131,7 @@ jobs:



# do we really need to timestamp yeah but not in release so will grep only publish release there

- name: Run Semantic Version (None Blocking)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -280,16 +279,7 @@ jobs:
echo "Listing packages.lock.json files:"
find . -name "packages.lock.json" -type f -print

#need to remove publish on build
# - name: Build Solution
# run: |
# dotnet build GitPageBlazorWASM.sln -c Release \
# /p:BCLVersion=$BCL_VERSION \
# /p:NupkgOutputPath=$NUPKG_OUTPUT_PATH \
# /p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE \
# /p:GhPageRelease=false \
# /p:LocalPackagePath=$BCL_Source
# /p:DisablePackageGeneration=true


- name: Build Shared Pages
run: |
Expand All @@ -311,13 +301,7 @@ jobs:
# echo "GITHUB_PACKAGES_TOKEN=$PACKAGES_TOKEN" >> $GITHUB_ENV




# /p:INDEPENDENT_CLIENT_GH_PAGES=true \
# env:
# INDEPENDENT_CLIENT_GH_PAGES: true

# Hardcode the INDEPENDENT_CLIENT_GH_PAGES value
# Hardcoding here the INDEPENDENT_CLIENT_GH_PAGES value
- name: Modify appsettings.json with hardcoded value
run: |
jq '.INDEPENDENT_CLIENT_GH_PAGES = "true"' TestHostPrerenderWASM/TestHostPrerenderWASM.Client/wwwroot/appsettings.json > tmp.json && mv tmp.json TestHostPrerenderWASM/TestHostPrerenderWASM.Client/wwwroot/appsettings.json
Expand Down Expand Up @@ -406,263 +390,3 @@ jobs:
ls -al ./docs
echo "Checking artifact details:"
gh api "repos/TechnologyEnhancedLearning/GitPageBlazorWASM/actions/runs/${GITHUB_RUN_ID}/artifacts"
# Make-Blazor-Wiki-Artifact-Trigger-GH-Pages-In-BlazorWasmTest:

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


# steps:
# - name: Checkout Code
# uses: actions/checkout@v4

# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# global-json-file: global.json

# # - name: Setup .NET
# # uses: actions/setup-dotnet@v3
# # with:
# # dotnet-version: '8.0.x'



# - name: Remove Local PackageSettings (CI Only)
# run: rm -f PackageSettings.props.local

# - name: Replace local environment variable in nuget config because cant provide it as a parameter
# run: |
# echo "sed -i \"s|%LocalPackagePath%|$BCL_Source|g\" nuget.config"
# sed -i "s|%LocalPackagePath%|$BCL_Source|g" nuget.config
# sed -i "s|%GITHUB_USERNAME%|$GITHUB_USERNAME|g" nuget.config
# sed -i "s|%GITHUB_PACKAGES_TOKEN%|$PACKAGES_TOKEN |g" nuget.config

# - name: debug BCL_VERSION
# run: |
# echo "BCL_VERSION $BCL_VERSION"

# - name: Clean lock files because the newly generated package file will superseed the locks
# run: |
# echo "Listing packages.lock.json files:"
# find . -name "packages.lock.json" -type f -print
# echo ""
# echo "Deleting packages.lock.json files:"
# find . -name "packages.lock.json" -type f -exec rm -f {} \;

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

# - name: Clean Solution
# run: |
# echo "Cleaning the solution..."
# dotnet clean GitPageBlazorWASM.sln

# # - name: Restore NuGet Packages
# # run: |
# # echo "Restoring NuGet packages..."
# # dotnet restore GitPageBlazorWASM.sln

#
# # fails because clieant as id expect if release
# # also fails becuase running at the solution level it does not respect the condition on not using the project reference

# # - name: Build Solution
# # run: |
# # echo "Building the solution..."
# # dotnet build GitPageBlazorWASM.sln -c Release \
# # /p:BCLVersion=$BCL_VERSION \
# # /p:NupkgOutputPath=$NUPKG_OUTPUT_PATH \
# # /p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE

# - name: Build Shared Pages
# run: |
# echo "Building the solution..."
# dotnet build SharedPages -c Release \
# /p:BCLVersion=$BCL_VERSION \
# /p:NupkgOutputPath=$NUPKG_OUTPUT_PATH \
# /p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE

# # - name: Build Shared Pages
# # run: |
# # dotnet build SharedPages -c Release \
# # /p:BCLVersion=$BCL_VERSION \
# # /p:NupkgOutputPath=$NUPKG_OUTPUT_PATH \
# # /p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE

# # - name: Debug Package References
# # run: |
# # echo "Debugging package references..."
# # dotnet restore GitPageBlazorWASM.sln
# # dotnet list GitPageBlazorWASM.sln package

# - name: Debug Directory package props
# run: |
# echo "Directory.Packages.props : "
# cat Directory.Packages.props
# echo ""


# # - name: Restoring client, isnt restoring library such that it restores solution enough to get the correct package so restoring the the whole solution
# # run: dotnet restore GitPageBlazorWASM.sln

# # - name: Restore NuGet Packages for Specifically the BCL Package Library Project
# # run: dotnet restore TestHostPrerenderWASM/TestHostPrerenderWASM.Client/TestHostPrerenderWASM.Client.csproj

# - name: Debug client values
# run: |
# echo "IsLocalDev: $IS_LOCAL_DEV"
# echo "BCLVersion: $BCL_VERSION"
# echo "UseBCLProjectReference: $USE_BCL_PROJECT_REFERENCE"



# - name: is it because solution level not receive /p for project so need githun_env values
# run: |
# echo "BCLVersion=$BCL_VERSION" >> $GITHUB_ENV
# echo "LocalPackagePath=$BCL_SOURCE" >> $GITHUB_ENV
# echo "GITHUB_USERNAME=$GITHUB_USERNAME" >> $GITHUB_ENV
# echo "IsLocalDev=$IS_LOCAL_DEV" >> $GITHUB_ENV
# echo "UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE" >> $GITHUB_ENV
# #echo "GITHUB_PACKAGES_TOKEN=$PACKAGES_TOKEN" >> $GITHUB_ENV

# - name: now try restore again
# run: |
# dotnet Restore
# cat Directory.Packages.props
# echo "doesnt work"

# - name: Display Environment Variable (for debugging)
# run: echo "BCLVERSION is $BCLVERSION"




# - name: Debug artifact location
# run: |
# # Get the artifact list for the current workflow run
# ARTIFACT_LIST=$(gh api "repos/TechnologyEnhancedLearning/GitPageBlazorWASM/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 GitPageBlazorWASM-Test Repository
# run: |
# # Set the required variables
# repo_owner="TechnologyEnhancedLearning" # Replace with the repository owner (organization or user)
# repo_name="GitPageBlazorWASM-TestGHPage" # Replace with the repository name
# event_type="artifact_ready"
# #artifact_url="https://api.github.com/repos/TechnologyEnhancedLearning/GitPageBlazorWASM/actions/artifacts/2859947943"
# # Trigger the workflow in another repository
# curl -L \
# -X POST \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ secrets.PACKAGES_TOKEN }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
# -d "{\"event_type\": \"$event_type\", \"client_payload\": {\"artifact_url\": \"$artifact_url\"}}"

# - name: Debug - List all files
# run: |
# echo "Listing files in the root directory:"
# ls -al
# echo "Listing files in the docs directory:"
# ls -al ./docs
# echo "Checking artifact details:"
# gh api "repos/TechnologyEnhancedLearning/GitPageBlazorWASM/actions/runs/${GITHUB_RUN_ID}/artifacts"

# # No this will be in the release branch that we do a prod wiki host
# # - name: Deploy to GitHub Pages
# # uses: JamesIves/github-pages-deploy-action@v4
# # with:
# # folder: docs # The folder the action should deploy
# # branch: gh-pages # The branch the action should deploy to



# Previously we passed the value
# name: Deploy to GitHub Pages

# on:
# #push:
# # branches: [ master ]
# workflow_run:
# workflows: ["Build BCL Package"] # Name of the workflow to trigger from.
# types:
# - completed

# Same pipeline shouldnt need it now
# get-bcl-version:
# runs-on: ubuntu-latest
# outputs:
# bcl-version: ${{ steps.get-bcl-version-from-git-packages.outputs.latest-bcl-version }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3


# - name: Get BCL Version from Git Packages
# id: get-bcl-version-from-git-packages
# run: |
# TOKEN="$GITHUB_TOKEN"
# OWNER="Phil-NHS"
# PACKAGE_NAME="TELBlazorComponentLibrary.GitPageBlazorWasm"
# BCL_PACKAGE_PATH="https://api.github.com/users/$OWNER/packages/nuget/$PACKAGE_NAME/versions"
# echo "API Path: $BCL_PACKAGE_PATH"
# VERSION_JSON=$(curl -s -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.github+json" $BCL_PACKAGE_PATH)
# echo "$VERSION_JSON"
# LATEST_VERSION=$(echo "$VERSION_JSON" | jq -r '.[0].name')
# echo "latest-bcl-version=$LATEST_VERSION" >> $GITHUB_OUTPUT
# - name: Run Semantic Dev Release
# id: set-dev-semantic-version
# run: |
# npx semantic-release
# echo "dev-version=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - 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

# - name: Run Semantic Release Dry Run
# run: |
# echo "Running Semantic Release dry run..."
# SEMVER_OUTPUT_DRY=$(npx semantic-release --dry-run)
# echo "Dry run output $SEMVER_OUTPUT_DRY"

# - name: Get Semantic Version
# id: set-dev-semantic-version
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# echo "Running Semantic Release dry run..."
# SEMVER_OUTPUT=$(npx semantic-release --dry-run)
# echo "Semantic Release Output: $SEMVER_OUTPUT"

# # Debug: Check exit code of semantic-release
# SEMVER_EXIT_CODE=$?
# echo "Semantic Release Exit Code: $SEMVER_EXIT_CODE"

# SEMVER_VERSION=$(npx semantic-release --dry-run | grep -oP 'Published release \K[\d.]+')

# #SEMVER_VERSION=$(npx semantic-release --dry-run | grep -oP 'Published release \K[\d.]+' || echo "0.1.0")

# TIMESTAMP=$(date +"%y%m%d-%H-%M-%S")
# BRANCH_NAME=$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's/[^a-zA-Z0-9.-]/_/g')
# FULL_VERSION="${SEMVER_VERSION}-DEV-${BRANCH_NAME}-${TIMESTAMP}"
# echo "Extracted Version: $FULL_VERSION"
# echo "dev-semantic-version=$FULL_VERSION" >> $GITHUB_OUTPUT
8 changes: 4 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
configFile: .commitlintrc.json


# built in to our organisation anyway
# gitguardian-scan:
# name: gitguardian
# runs-on: ubuntu-latest
Expand All @@ -53,15 +53,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: See other project pipeline for Tests
run: echo "qqqq See other project pipeline for Tests this is a placeholder"
run: echo " See other project pipeline for Tests this is a placeholder"


E2E-Tests:
name: todo e2e tests
runs-on: ubuntu-latest
steps:
- name: See other project pipeline for Tests
run: echo "qqqq See other project pipeline for Tests this is a placeholder"
run: echo " See other project pipeline for Tests this is a placeholder"


Code-Coverage:
Expand All @@ -86,7 +86,7 @@ jobs:
# - name: all checks passed steps
# run: echo "allow all checks to run incase multiple fails then fail here"

# wanted to do it like this
# wanted to do it like this it worked neither is putting check in pr git ui but is running in pipeline
# Code-Coverage:
# name: code coverage
# runs-on: ubuntu-latest
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ jobs:
- name: Create docs directory
run: mkdir -p docs



# Print the contents of appsettings.json inside 'TestHostPrerenderWASM.Client' folder
# - name: Display appsettings.json content
# run: cat TestHostPrerenderWASM/TestHostPrerenderWASM.Client/wwwroot/appsettings.json

- name: Publish client using client release .csproj logic
run: |
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [9.1.6-fix-did-pull-break-yml.1](https://github.com/TechnologyEnhancedLearning/GitPageBlazorWASM/compare/v9.1.5...v9.1.6-fix-did-pull-break-yml.1) (2025-04-15)


### Bug Fixes

* **chore but want:** to see build ([27af663](https://github.com/TechnologyEnhancedLearning/GitPageBlazorWASM/commit/27af6630c8aadfe4bdffc3504cd0931bf55206c5))

## [9.1.5](https://github.com/TechnologyEnhancedLearning/GitPageBlazorWASM/compare/v9.1.4...v9.1.5) (2025-04-15)


Expand Down