From cc7e8c51d19b1e13fc2aa0c65d2b1089e4ccd364 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 13:07:39 +0200 Subject: [PATCH 1/8] ci: cleanup jenkins leftovers --- package.json | 4 ---- sandbox.config.json | 3 --- setupJest.js | 1 - webpack/deploy.js | 34 ---------------------------------- webpack/versioning.js | 29 ----------------------------- 5 files changed, 71 deletions(-) delete mode 100644 sandbox.config.json delete mode 100644 setupJest.js delete mode 100644 webpack/deploy.js delete mode 100644 webpack/versioning.js diff --git a/package.json b/package.json index 4107bc52..accfe2d7 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,6 @@ "analyze:light": "WEBPACK_BUILD_LIGHT=1 webpack --config webpack/analyzer.config.js", "postbuild-all": "bundlewatch", "precommit": "eslint src", - "predeploy": "deploy=true npm run build-all", - "deploy": "deploy=true node webpack/deploy.js", - "postdeploy": "git push origin master --follow-tags", - "dry:deploy": "node webpack/deploy.js dry", "test": "jest --no-cache --detectOpenHandles", "test:unit": "UNIT=TRUE jest --no-cache --env jsdom --testMatch='/test/unit/*.test.js'", "snyk-protect": "snyk protect", diff --git a/sandbox.config.json b/sandbox.config.json deleted file mode 100644 index 003bcb1c..00000000 --- a/sandbox.config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "template": "static" -} \ No newline at end of file diff --git a/setupJest.js b/setupJest.js deleted file mode 100644 index d36d1111..00000000 --- a/setupJest.js +++ /dev/null @@ -1 +0,0 @@ -require('jest-fetch-mock').enableMocks(); diff --git a/webpack/deploy.js b/webpack/deploy.js deleted file mode 100644 index da7be1cb..00000000 --- a/webpack/deploy.js +++ /dev/null @@ -1,34 +0,0 @@ -const ver = require('./versioning'); - -const { execSync } = require('child_process'); - -const tag = ver.extractTag(); - -const VERSION = (process.env.deploy === 'true') - ? JSON.stringify(ver.getNextVersion(tag)) - : JSON.stringify(require('../package.json').version); - -const versionCmd = () => `npm version ${VERSION}`; - -const publishCmd = (tag) => { - let cmd = 'npm publish'; - - if (tag === 'edge') { - cmd += ' --tag edge'; - } else { - cmd += ' --tag latest'; - } - - return cmd; -}; - -if (tag === 'dry') { - console.log(`"edge" will deploy: "${ver.getNextVersion('edge')}"`); - console.log(`"stable" will deploy: "${ver.getNextVersion('stable')}"`); - console.log(`"minor" will deploy: "${ver.getNextVersion('minor')}"`); - console.log(`"major" will deploy: "${ver.getNextVersion('major')}"`); -} else { - const cmd = `${versionCmd()} && ${publishCmd(tag)}`; - console.log(`Executing: "${cmd}" ...`); - execSync(cmd); -} diff --git a/webpack/versioning.js b/webpack/versioning.js deleted file mode 100644 index e8cb8164..00000000 --- a/webpack/versioning.js +++ /dev/null @@ -1,29 +0,0 @@ -const semver = require('semver'); -const CURRENT_VERSION = require('../package.json').version; -const VALID_TAGS = ['edge', 'stable', 'latest', 'minor', 'major', 'dry']; - -const nextSemver = { - 'edge': () => semver.inc(CURRENT_VERSION, 'prerelease', undefined, 'edge'), - 'stable': () => semver.inc(CURRENT_VERSION, 'patch'), - 'minor': () => semver.inc(CURRENT_VERSION, 'minor'), - 'major': () => semver.inc(CURRENT_VERSION, 'major') -}; - -const extractTag = () => { - const tag = process.env.npm_config_tag; - console.log('Current config tag: "' + tag + '"'); - - if (!tag) { - return 'edge'; - } - - if (!VALID_TAGS.find((t) => t === tag)) { - throw new Error(`Invalid tag ${tag}. Valid tags are: ${VALID_TAGS.join(', ')}`); - } - - return tag; -}; - -const getNextVersion = (tag) => nextSemver[tag] && nextSemver[tag](); - -module.exports = { extractTag, getNextVersion }; From 537c7d9c62cfe06e4887239c0e916811c86d0aa4 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 13:20:28 +0200 Subject: [PATCH 2/8] ci: set-output command is deprecated --- .github/workflows/validate.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 82d2967d..c95ed0b8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,9 +31,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - OUTPUT=$(npx semantic-release --dry-run) - echo "::set-output name=changelog::$OUTPUT" + run: echo "changelog=$(npx semantic-release --dry-run)" >> $GITHUB_OUTPUT - name: Comment PR uses: actions/github-script@v5 From 3b57b94973768dbcb43d0e9ba3a3a47760dbd001 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 13:25:53 +0200 Subject: [PATCH 3/8] ci: set-output command is deprecated --- .github/workflows/validate.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c95ed0b8..2132877d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,7 +31,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: echo "changelog=$(npx semantic-release --dry-run)" >> $GITHUB_OUTPUT + run: | + OUTPUT=$(npx semantic-release --dry-run) + echo "changelog=$OUTPUT" >> $GITHUB_OUTPUT - name: Comment PR uses: actions/github-script@v5 From b80269fb2a15ac0a11f07dc3c599b5d1991a92f8 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 13:35:27 +0200 Subject: [PATCH 4/8] ci: set-output command is deprecated --- .github/workflows/validate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2132877d..11f91e8c 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,8 +32,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - OUTPUT=$(npx semantic-release --dry-run) - echo "changelog=$OUTPUT" >> $GITHUB_OUTPUT + echo 'changelog<> $GITHUB_OUTPUT + echo $(npx semantic-release --dry-run) >> $GITHUB_OUTPUT + echo 'EOF' >> $GITHUB_OUTPUT - name: Comment PR uses: actions/github-script@v5 From d272995d3b21226798bd1a0c88548768b148a325 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 14:53:04 +0200 Subject: [PATCH 5/8] ci: set-output command is deprecated --- .github/workflows/validate.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 11f91e8c..23cb6a36 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -49,18 +49,17 @@ jobs: const botComment = comments.find(comment => comment.user.login === 'github-actions[bot]'); - const message = `${{ steps.changelog.outputs.changelog }}`; - if (botComment) { await github.rest.issues.updateComment({ ...context.repo, comment_id: botComment.id, body: message + body: `${{steps.changelog.outputs.changelog}}` }); } else { await github.rest.issues.createComment({ ...context.repo, issue_number, - body: message + body: `${{steps.changelog.outputs.changelog}}` }); } From 30fde59699f5d20ab705de41eefc74f2d99783fb Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 14:56:46 +0200 Subject: [PATCH 6/8] ci: set-output command is deprecated --- .github/workflows/validate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 23cb6a36..174a1918 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -53,7 +53,6 @@ jobs: await github.rest.issues.updateComment({ ...context.repo, comment_id: botComment.id, - body: message body: `${{steps.changelog.outputs.changelog}}` }); } else { From cb893061e3fd7b785cccafe720147f82fc73b932 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 15:05:37 +0200 Subject: [PATCH 7/8] ci: set-output command is deprecated --- .github/workflows/validate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 174a1918..55c85593 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,9 +32,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - echo 'changelog<> $GITHUB_OUTPUT - echo $(npx semantic-release --dry-run) >> $GITHUB_OUTPUT - echo 'EOF' >> $GITHUB_OUTPUT + echo "changelog<> $GITHUB_OUTPUT + echo "$(npx semantic-release --dry-run)" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: Comment PR uses: actions/github-script@v5 From b90abf3b329bef9021e549a182c554edd40b5ba8 Mon Sep 17 00:00:00 2001 From: Tsachi Shlidor Date: Mon, 25 Dec 2023 15:09:32 +0200 Subject: [PATCH 8/8] chore: job name --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 55c85593..93e35f8d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -4,7 +4,7 @@ on: pull_request: jobs: - preview: + validate: runs-on: ubuntu-latest steps: