⬆️(deps-dev): Bump esbuild from 0.27.4 to 0.28.0 #118
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: CI/CD | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ci-cd-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_VERSION: '22' | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - name: Restore dependency cache | |
| id: deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.npm | |
| node_modules | |
| key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-${{ env.NODE_VERSION }}- | |
| - name: Install dependencies (clean) | |
| if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} | |
| run: npm ci --prefer-offline --no-audit --fund=false | |
| - name: Refresh dependencies (cached) | |
| if: ${{ steps.deps-cache.outputs.cache-hit == 'true' }} | |
| run: npm install --prefer-offline --no-audit --fund=false | |
| - name: Run lint | |
| run: npm run lint | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - name: Restore dependency cache | |
| id: deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.npm | |
| node_modules | |
| key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-${{ env.NODE_VERSION }}- | |
| - name: Install dependencies (clean) | |
| if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} | |
| run: npm ci --prefer-offline --no-audit --fund=false | |
| - name: Refresh dependencies (cached) | |
| if: ${{ steps.deps-cache.outputs.cache-hit == 'true' }} | |
| run: npm install --prefer-offline --no-audit --fund=false | |
| - name: Run tests (coverage) | |
| run: npm run test | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| if: ${{ success() && (github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - name: Restore dependency cache | |
| id: deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.npm | |
| node_modules | |
| key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-${{ env.NODE_VERSION }}- | |
| - name: Install dependencies (clean) | |
| if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} | |
| run: npm ci --prefer-offline --no-audit --fund=false | |
| - name: Refresh dependencies (cached) | |
| if: ${{ steps.deps-cache.outputs.cache-hit == 'true' }} | |
| run: npm install --prefer-offline --no-audit --fund=false | |
| - name: Validate tag format | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| run: npm run validate:tags -- --ref "${GITHUB_REF_NAME}" | |
| - name: Build SPA + include importer executable | |
| run: npm run dist | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ github.event.repository.name }}-${{ github.ref_name }}-dist-artifact | |
| path: dist | |
| if-no-files-found: error | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ github.event.repository.name }}-${{ github.ref_name }}-dist-artifact | |
| path: dist | |
| - name: Prepare release files | |
| run: | | |
| mkdir -p release | |
| cp -r dist release/${{ github.event.repository.name }} | |
| (cd release && zip -qr ${{ github.event.repository.name }}-${{ github.ref_name }}.zip ${{ github.event.repository.name }}) | |
| rm -rf release/${{ github.event.repository.name }} | |
| cp dist/import-dataset release/import-dataset | |
| sha256sum release/${{ github.event.repository.name }}-${{ github.ref_name }}.zip > release/checksums.txt | |
| sha256sum release/import-dataset >> release/checksums.txt | |
| awk '{print "- `" $2 "`: `" $1 "`"}' release/checksums.txt > release/checksums.md | |
| - name: Generate release notes | |
| run: | | |
| TAG_NAME="${GITHUB_REF_NAME:-v0.0.0}" | |
| bash scripts/generate-release-notes.sh \ | |
| "$TAG_NAME" \ | |
| "${GITHUB_REPOSITORY}" \ | |
| release/release-notes.txt \ | |
| release/checksums.md | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| body_path: release/release-notes.txt | |
| files: | | |
| release/${{ github.event.repository.name }}-${{ github.ref_name }}.zip | |
| release/import-dataset | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload release web artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ github.event.repository.name }}-${{ github.ref_name }}-release-web-artifact | |
| path: release/${{ github.event.repository.name }}-${{ github.ref_name }}.zip | |
| if-no-files-found: error | |
| deploy: | |
| name: Deploy Pages | |
| runs-on: ubuntu-latest | |
| needs: [release] | |
| if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download release web artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ github.event.repository.name }}-${{ github.ref_name }}-release-web-artifact | |
| path: release | |
| - name: Extract release web files | |
| run: | | |
| unzip -q release/${{ github.event.repository.name }}-${{ github.ref_name }}.zip | |
| mv ${{ github.event.repository.name }} dist | |
| - name: Upload pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Deploy pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| notify_failure: | |
| name: Notify Build Failure | |
| runs-on: ubuntu-latest | |
| needs: [test, build, release, deploy] | |
| if: ${{ always() && startsWith(github.ref, 'refs/tags/') && (needs.test.result == 'failure' || needs.build.result == 'failure' || needs.release.result == 'failure') }} | |
| steps: | |
| - name: Send failure notification | |
| run: | | |
| echo "Release failed for ${{ github.repository }} - ${{ github.ref_name }}" | |
| echo "Test result: ${{ needs.test.result }}" | |
| echo "Build result: ${{ needs.build.result }}" | |
| echo "Release result: ${{ needs.release.result }}" |