]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Remove dist folder from repo
authorMark Otto <markdotto@gmail.com>
Fri, 3 Oct 2025 15:37:40 +0000 (08:37 -0700)
committerMark Otto <markdotto@gmail.com>
Fri, 3 Oct 2025 15:37:40 +0000 (08:37 -0700)
- Update existing Actions to compile CSS and JS
- Add new Actions for dedicated compilation
- Update publish and release scripts to build and commit dist

.github/workflows/build-css.yml [new file with mode: 0644]
.github/workflows/build-js.yml [new file with mode: 0644]
.github/workflows/bundlewatch.yml
.github/workflows/cdn.yml [new file with mode: 0644]
.github/workflows/css.yml
.github/workflows/docs.yml
.github/workflows/js.yml
.github/workflows/publish-nuget.yml
.github/workflows/release.yml [new file with mode: 0644]
.gitignore

diff --git a/.github/workflows/build-css.yml b/.github/workflows/build-css.yml
new file mode 100644 (file)
index 0000000..23304db
--- /dev/null
@@ -0,0 +1,46 @@
+name: Build CSS
+
+on:
+  pull_request:
+    paths:
+      - 'scss/**'
+      - 'build/**'
+      - 'package.json'
+      - 'package-lock.json'
+  workflow_dispatch:
+
+env:
+  FORCE_COLOR: 2
+  NODE: 22
+
+permissions:
+  contents: read
+
+jobs:
+  build-css:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build CSS
+        run: npm run css
+
+      - name: Upload CSS artifacts
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: css-dist
+          path: dist/css/
+          retention-days: 1
diff --git a/.github/workflows/build-js.yml b/.github/workflows/build-js.yml
new file mode 100644 (file)
index 0000000..fd3fc8f
--- /dev/null
@@ -0,0 +1,46 @@
+name: Build JS
+
+on:
+  pull_request:
+    paths:
+      - 'js/**'
+      - 'build/**'
+      - 'package.json'
+      - 'package-lock.json'
+  workflow_dispatch:
+
+env:
+  FORCE_COLOR: 2
+  NODE: 22
+
+permissions:
+  contents: read
+
+jobs:
+  build-js:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build JS
+        run: npm run js
+
+      - name: Upload JS artifacts
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: js-dist
+          path: dist/js/
+          retention-days: 1
index 9a1d81679e89b3b990f68698dcf93c754e47fe29..3e4388a14b7e7e594b83efd5e7a06b33af2df297 100644 (file)
@@ -15,7 +15,51 @@ permissions:
   contents: read
 
 jobs:
+  build-dist:
+    runs-on: ubuntu-latest
+    outputs:
+      css-artifact: ${{ steps.css-artifact.outputs }}
+      js-artifact: ${{ steps.js-artifact.outputs }}
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build CSS
+        run: npm run css
+
+      - name: Build JS
+        run: npm run js
+
+      - name: Upload CSS artifacts
+        id: css-artifact
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: css-dist
+          path: dist/css/
+          retention-days: 1
+
+      - name: Upload JS artifacts
+        id: js-artifact
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: js-dist
+          path: dist/js/
+          retention-days: 1
+
   bundlewatch:
+    needs: build-dist
     runs-on: ubuntu-latest
 
     steps:
@@ -33,8 +77,17 @@ jobs:
       - name: Install npm dependencies
         run: npm ci
 
-      - name: Run dist
-        run: npm run dist
+      - name: Download CSS artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: css-dist
+          path: dist/css/
+
+      - name: Download JS artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: js-dist
+          path: dist/js/
 
       - name: Run bundlewatch
         run: npm run bundlewatch
diff --git a/.github/workflows/cdn.yml b/.github/workflows/cdn.yml
new file mode 100644 (file)
index 0000000..06941a7
--- /dev/null
@@ -0,0 +1,51 @@
+name: CDN Distribution
+
+on:
+  release:
+    types: [published]
+  workflow_dispatch:
+
+env:
+  FORCE_COLOR: 2
+  NODE: 22
+
+permissions:
+  contents: read
+
+jobs:
+  build-cdn:
+    runs-on: ubuntu-latest
+    if: ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }}
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build CSS
+        run: npm run css
+
+      - name: Build JS
+        run: npm run js
+
+      - name: Generate SRI hashes
+        run: npm run release-sri
+
+      - name: Upload to CDN
+        # This would typically upload to a CDN service like jsDelivr, unpkg, etc.
+        # The actual implementation would depend on the CDN service used
+        run: |
+          echo "CDN upload would happen here"
+          echo "Files ready for CDN distribution:"
+          ls -la dist/css/
+          ls -la dist/js/
index 8fd608c430e9f4c1ab9b7dd65587be24295fccf4..7ae79a6a5db5ef5f8dbcd44eec2d81d404f284e7 100644 (file)
@@ -15,8 +15,10 @@ permissions:
   contents: read
 
 jobs:
-  css:
+  build-css:
     runs-on: ubuntu-latest
+    outputs:
+      css-artifact: ${{ steps.css-artifact.outputs }}
 
     steps:
       - name: Clone repository
@@ -36,5 +38,38 @@ jobs:
       - name: Build CSS
         run: npm run css
 
+      - name: Upload CSS artifacts
+        id: css-artifact
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: css-dist
+          path: dist/css/
+          retention-days: 1
+
+  css:
+    needs: build-css
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Download CSS artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: css-dist
+          path: dist/css/
+
       - name: Run CSS tests
         run: npm run css-test
index 93035f41dec939b323eb51833536c9d71e642bc5..5e9ce577eef71a9c1f65d939994a6d80abaf5622 100644 (file)
@@ -15,7 +15,51 @@ permissions:
   contents: read
 
 jobs:
+  build-dist:
+    runs-on: ubuntu-latest
+    outputs:
+      css-artifact: ${{ steps.css-artifact.outputs }}
+      js-artifact: ${{ steps.js-artifact.outputs }}
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build CSS
+        run: npm run css
+
+      - name: Build JS
+        run: npm run js
+
+      - name: Upload CSS artifacts
+        id: css-artifact
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: css-dist
+          path: dist/css/
+          retention-days: 1
+
+      - name: Upload JS artifacts
+        id: js-artifact
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: js-dist
+          path: dist/js/
+          retention-days: 1
+
   docs:
+    needs: build-dist
     runs-on: ubuntu-latest
 
     steps:
@@ -33,6 +77,18 @@ jobs:
       - name: Install npm dependencies
         run: npm ci
 
+      - name: Download CSS artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: css-dist
+          path: dist/css/
+
+      - name: Download JS artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: js-dist
+          path: dist/js/
+
       - name: Build docs
         run: npm run docs-build
 
index 5606ecf7fd0b2bbec2a49b631fd645c831f992c2..59b922f0ebc7aeb2a02a35c377f95fe37e36e9ad 100644 (file)
@@ -15,7 +15,39 @@ permissions:
   contents: read
 
 jobs:
+  build-js:
+    runs-on: ubuntu-latest
+    outputs:
+      js-artifact: ${{ steps.js-artifact.outputs }}
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: ${{ env.NODE }}
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build JS
+        run: npm run js
+
+      - name: Upload JS artifacts
+        id: js-artifact
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        with:
+          name: js-dist
+          path: dist/js/
+          retention-days: 1
+
   run:
+    needs: build-js
     permissions:
       # allow coverallsapp/github-action to create new checks issues and fetch code
       checks: write
@@ -38,8 +70,11 @@ jobs:
       - name: Install npm dependencies
         run: npm ci
 
-      - name: Run dist
-        run: npm run js
+      - name: Download JS artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: js-dist
+          path: dist/js/
 
       - name: Run JS tests
         run: npm run js-test
index b78023b92aa578193b4e719e914518f86a257ee8..ad5c554e59cf19d135dcd64ebc64969061e6cd67 100644 (file)
@@ -13,11 +13,28 @@ jobs:
     if: ${{ github.repository == 'twbs/bootstrap' && startsWith(github.event.release.tag_name, 'v') }}
     env:
       GITHUB_REF_NAME: ${{ github.ref_name }}
+      FORCE_COLOR: 2
+      NODE: 22
     steps:
       - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
         with:
           persist-credentials: false
 
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build CSS
+        run: npm run css
+
+      - name: Build JS
+        run: npm run js
+
       - name: Set up NuGet
         uses: nuget/setup-nuget@323ab0502cd38fdc493335025a96c8fdb0edc71f # v2.0.1
         with:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644 (file)
index 0000000..07b9655
--- /dev/null
@@ -0,0 +1,88 @@
+name: Release
+
+on:
+  release:
+    types: [published]
+  workflow_dispatch:
+
+env:
+  FORCE_COLOR: 2
+  NODE: 22
+
+permissions:
+  contents: write
+
+jobs:
+  build-and-release:
+    runs-on: ubuntu-latest
+    if: ${{ github.repository == 'twbs/bootstrap' && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') }}
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+        with:
+          persist-credentials: false
+
+      - name: Set up Node.js
+        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
+        with:
+          node-version: "${{ env.NODE }}"
+          cache: npm
+
+      - name: Install npm dependencies
+        run: npm ci
+
+      - name: Build CSS
+        run: npm run css
+
+      - name: Build JS
+        run: npm run js
+
+      - name: Generate SRI hashes
+        run: npm run release-sri
+
+      - name: Build docs
+        run: npm run docs-build
+
+      - name: Create release zip
+        run: npm run release-zip
+
+      - name: Create examples zip
+        run: npm run release-zip-examples
+
+      - name: Upload dist files to release
+        uses: actions/upload-release-asset@v1
+        if: ${{ github.event_name == 'release' }}
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          upload_url: ${{ github.event.release.upload_url }}
+          asset_path: ./bootstrap-${{ github.event.release.tag_name }}-dist.zip
+          asset_name: bootstrap-${{ github.event.release.tag_name }}-dist.zip
+          asset_content_type: application/zip
+
+      - name: Upload examples to release
+        uses: actions/upload-release-asset@v1
+        if: ${{ github.event_name == 'release' }}
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          upload_url: ${{ github.event.release.upload_url }}
+          asset_path: ./bootstrap-${{ github.event.release.tag_name }}-examples.zip
+          asset_name: bootstrap-${{ github.event.release.tag_name }}-examples.zip
+          asset_content_type: application/zip
+
+      - name: Commit dist files for npm
+        if: ${{ github.event_name == 'release' }}
+        run: |
+          git config --local user.email "action@github.com"
+          git config --local user.name "GitHub Action"
+          git add dist/
+          git commit -m "Add dist files for release ${{ github.event.release.tag_name }}" || exit 0
+          git push
+
+      - name: Publish to npm
+        if: ${{ github.event_name == 'release' }}
+        run: npm publish
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
index 235ad54948dd6458fef80beff4b571b97ede0746..6d2c89f966329831004f1bfcc1e73c9e306ae491 100644 (file)
@@ -34,6 +34,7 @@ Thumbs.db
 *.komodoproject
 
 # Folders to ignore
+/dist/
 /dist-sass/
 /js/coverage/
 /node_modules/