Add error-message-prefix attribute to all date inputs examples #584
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Build & release" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| tags: | |
| - v* | |
| paths-ignore: | |
| - docs/** | |
| - LICENSE | |
| - "**.md" | |
| pull_request: | |
| branches: | |
| - "*" | |
| paths-ignore: | |
| - docs/** | |
| - LICENSE | |
| - "**.md" | |
| jobs: | |
| format: | |
| name: "Check code format" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/workflows/actions/setup-tools | |
| - name: Format | |
| run: just format --verify-no-changes | |
| build_debug: | |
| name: "Debug build" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/workflows/actions/setup-tools | |
| - name: Restore | |
| run: just restore | |
| - name: Build | |
| run: just build --configuration Debug --no-restore | |
| - name: Install Playwright | |
| run: just install-playwright | |
| - name: Test | |
| run: | | |
| just unit-tests --configuration Debug --no-build | |
| just integration-tests --configuration Debug --no-build | |
| build_release: | |
| name: "Release build & package" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 # required for minver to create the right version number | |
| filter: tree:0 | |
| - uses: ./.github/workflows/actions/setup-tools | |
| - name: Restore | |
| run: just restore | |
| - name: Format | |
| run: just format --verify-no-changes | |
| - name: Build | |
| run: just build --configuration Release --no-restore | |
| - name: Install Playwright | |
| run: just install-playwright | |
| - name: Test | |
| run: | | |
| just unit-tests --configuration Release --no-build | |
| just integration-tests --configuration Release --no-build | |
| - name: Assign package build metadata | |
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
| run: | | |
| echo "MINVERBUILDMETADATA=build.${{ github.run_id }}.${{ github.run_attempt}}" >> $GITHUB_ENV | |
| - name: Update package README GitHub link | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/tags/v"* ]]; then | |
| REF="${{ github.ref_name }}" | |
| else | |
| REF="${{ github.sha }}" | |
| fi | |
| README_PATH="src/GovUk.Frontend.AspNetCore/Package/README.md" | |
| ORIGINAL_URL="https://github.com/${{ github.repository }}/blob/main/" | |
| NEW_URL="https://github.com/${{ github.repository }}/blob/${REF}/" | |
| if ! grep -q "$ORIGINAL_URL" "$README_PATH"; then | |
| echo "::error::Expected URL pattern '$ORIGINAL_URL' not found in $README_PATH" | |
| exit 1 | |
| fi | |
| sed -i "s|${ORIGINAL_URL}|${NEW_URL}|g" "$README_PATH" | |
| echo "Updated README link to reference: ${REF}" | |
| - name: Pack | |
| run: just pack --configuration Release | |
| - name: Publish package artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: GovUk.Frontend.AspNetCore.nupkg | |
| path: packages/*.nupkg | |
| build_samples: | |
| name: "Build samples" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - uses: ./.github/workflows/actions/setup-tools | |
| - name: Build samples | |
| run: just build-samples --configuration Release | |
| docs: | |
| name: "Check docs" | |
| runs-on: ubuntu-latest | |
| needs: [build_release] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/workflows/actions/setup-tools | |
| - name: Check component documentation | |
| run: | | |
| just publish-docs --configuration Release | |
| changes=$(git status --porcelain docs ':!docs/images' | cut -c 4-) | |
| if [ -n "$changes" ] | |
| then | |
| echo "::error ::Documentation is stale" | |
| exit 1 | |
| fi | |
| - name: Check GOV.UK Design System version | |
| run: | | |
| # Extract version from Directory.Build.props | |
| props_version=$(grep -oP '<GovUkFrontendVersion>\K[^<]+' Directory.Build.props) | |
| if [ -z "$props_version" ]; then | |
| echo "::error ::Failed to extract version from Directory.Build.props" | |
| exit 1 | |
| fi | |
| echo "Version in Directory.Build.props: $props_version" | |
| # Extract version from README badge (supports semantic versioning including pre-release versions) | |
| readme_version=$(grep -oP 'GOV\.UK%20Design%20System-\K[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9.]+)?(?=-)' README.md) | |
| if [ -z "$readme_version" ]; then | |
| echo "::error ::Failed to extract version from README.md badge" | |
| exit 1 | |
| fi | |
| echo "Version in README.md: $readme_version" | |
| # Compare versions | |
| if [ "$props_version" != "$readme_version" ]; then | |
| echo "::error ::GOV.UK Design System version mismatch: Directory.Build.props has $props_version but README.md has $readme_version" | |
| exit 1 | |
| fi | |
| echo "✓ Versions match: $props_version" | |
| release: | |
| name: "Publish package to NuGet" | |
| runs-on: ubuntu-latest | |
| needs: [format, build_release, build_samples, docs] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/workflows/actions/setup-tools | |
| - name: Download package artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: GovUk.Frontend.AspNetCore.nupkg | |
| - name: NuGet login | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Publish package to NuGet | |
| run: dotnet nuget push **/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |