]> source.dussan.org Git - jquery.git/commitdiff
Release: ensure builds have the proper version
authorTimmy Willison <timmywil@users.noreply.github.com>
Wed, 17 Jul 2024 13:32:02 +0000 (09:32 -0400)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2024 13:32:02 +0000 (09:32 -0400)
- order hooks in execution order
- update workflow actions

Closes gh-5519

.github/workflows/verify-release.yml
.release-it.cjs
build/release/verify.js
package-lock.json
package.json

index 89dbc7b65de48e7eb46e5e490e9421ffbd93d0dc..cd43efac2cd9599ffdf741d77eaa1c0b930cc55c 100644 (file)
@@ -21,10 +21,10 @@ jobs:
       NODE_VERSION: 20.x
     steps:
       - name: Checkout
-        uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
+        uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
 
       - name: Use Node.js ${{ env.NODE_VERSION }}
-        uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
+        uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
         with:
           node-version: ${{ env.NODE_VERSION }}
 
index 2061e01605441b340bc5a47a0f14f484ce50d134..1de0de548611e6396b41d2c07db6224e13b2907a 100644 (file)
@@ -10,11 +10,11 @@ module.exports = {
        preReleaseBase: 1,
        hooks: {
                "before:init": "bash ./build/release/pre-release.sh",
-               "before:git:release": "git add -f dist/ dist-module/ changelog.md",
                "after:version:bump":
                        "sed -i 's/main\\/AUTHORS.txt/${version}\\/AUTHORS.txt/' package.json",
-               "after:release":
-                       `bash ./build/release/post-release.sh \${version} ${ blogURL }`
+               "after:bump": "cross-env VERSION=${version} npm run build:all",
+               "before:git:release": "git add -f dist/ dist-module/ changelog.md",
+               "after:release": `bash ./build/release/post-release.sh \${version} ${ blogURL }`
        },
        git: {
                changelog: "npm run release:changelog -- ${from} ${to}",
index 43d77f80099c9c1a5ba096b3f6264356ed0f554d..f167666b22358a579a3222cb387ce0c6e96da170 100644 (file)
@@ -24,13 +24,14 @@ const REGISTRY_URL = "https://registry.npmjs.org/jquery";
 
 const rstable = /^(\d+\.\d+\.\d+)$/;
 
-export async function verifyRelease( { version } = {} ) {
+async function verifyRelease( { version } = {} ) {
        if ( !version ) {
                version = process.env.VERSION || ( await getLatestVersion() );
        }
-       console.log( `Checking jQuery ${ version }...` );
        const release = await buildRelease( { version } );
 
+       console.log( `Verifying jQuery ${ version }...` );
+
        let verified = true;
 
        // Only check stable versions against the CDN
@@ -139,8 +140,8 @@ async function buildRelease( { version } ) {
                        .filter( ( dirent ) => dirent.isFile() )
                        .map( async( dirent ) => ( {
                                name: dirent.name,
-                               path: path.basename( dirent.path ),
-                               contents: await readFile( path.join( dirent.path, dirent.name ), "utf8" )
+                               path: path.basename( dirent.parentPath ),
+                               contents: await readFile( path.join( dirent.parentPath, dirent.name ), "utf8" )
                        } ) )
        );
 
@@ -196,3 +197,5 @@ async function sumTarball( filepath ) {
        const unzipped = await gunzip( contents );
        return shasum( unzipped );
 }
+
+verifyRelease();
index c21877130e18d5a47dce0be5fba06b9eb12cd1c7..813c769f180693356ef5c63a2fc8ad82ba17ba3c 100644 (file)
@@ -26,6 +26,7 @@
         "commitplease": "3.2.0",
         "concurrently": "8.2.2",
         "core-js-bundle": "3.37.1",
+        "cross-env": "7.0.3",
         "diff": "5.2.0",
         "eslint": "8.57.0",
         "eslint-config-jquery": "3.0.2",
         "node": ">= 14"
       }
     },
+    "node_modules/cross-env": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
+      "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+      "dev": true,
+      "dependencies": {
+        "cross-spawn": "^7.0.1"
+      },
+      "bin": {
+        "cross-env": "src/bin/cross-env.js",
+        "cross-env-shell": "src/bin/cross-env-shell.js"
+      },
+      "engines": {
+        "node": ">=10.14",
+        "npm": ">=6",
+        "yarn": ">=1"
+      }
+    },
     "node_modules/cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
index 000f947f7aee10c1aa37ab1459d6633ec6b102d4..30cb40ae799b025410875f976e1558477788c046 100644 (file)
@@ -64,7 +64,7 @@
     "release:changelog": "node build/release/changelog.js",
     "release:clean": "rimraf tmp --glob changelog.{md,html} contributors.html",
     "release:dist": "node build/release/dist.js",
-    "release:verify": "node -e \"(async () => { const { verifyRelease } = await import('./build/release/verify.js'); verifyRelease() })()\"",
+    "release:verify": "node build/release/verify.js",
     "start": "node -e \"(async () => { const { buildDefaultFiles } = await import('./build/tasks/build.js'); buildDefaultFiles({ watch: true }) })()\"",
     "test:bundlers": "npm run pretest && npm run build:all && node test/bundler_smoke_tests/run-jsdom-tests.js",
     "test:browser": "npm run pretest && npm run build:main && npm run test:unit -- -b chrome -b firefox -h",
     "commitplease": "3.2.0",
     "concurrently": "8.2.2",
     "core-js-bundle": "3.37.1",
+    "cross-env": "7.0.3",
     "diff": "5.2.0",
     "eslint": "8.57.0",
     "eslint-config-jquery": "3.0.2",