diff --git a/.github/workflows/approveAndPublishBeta.yml b/.github/workflows/approveAndPublishBeta.yml new file mode 100644 index 0000000000..5b3acbae7d --- /dev/null +++ b/.github/workflows/approveAndPublishBeta.yml @@ -0,0 +1,28 @@ +name: Approve and Publish Beta Release Branch +on: + workflow_run: + workflows: + - Create and Test Beta Release Branch + types: + - completed + workflow_dispatch: + inputs: + runId: + description: 'Run ID of the workflow run that created the vsixes' + required: true + type: string + +jobs: + confirm_publish: + environment: publish + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} # Only run this if the previous workflow was successful + name: 'Confirm Publish Beta Release' + steps: + - run: echo "Please confirm to publish the beta release" + publish_beta: + needs: confirm_publish + uses: ./.github/workflows/publishBeta.yml + secrets: inherit + with: + runId: ${{ inputs.runId || github.event.workflow_run.id }} diff --git a/.github/workflows/createAndTestBetaReleaseBranch.yml b/.github/workflows/createAndTestBetaReleaseBranch.yml new file mode 100644 index 0000000000..500c80ee19 --- /dev/null +++ b/.github/workflows/createAndTestBetaReleaseBranch.yml @@ -0,0 +1,63 @@ +name: Create and Test Beta Release Branch + +on: + workflow_dispatch: + +jobs: + create_branch: + name: 'Create Branch' + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + branch: ${{ steps.branch.outputs.branch }} + result: ${{ steps.result.outputs.result }} + env: + RELEASE_TYPE: 'beta' + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: 'main' + ssh-strict: false + token: ${{ secrets.IDEE_GH_TOKEN }} + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - uses: ./.github/actions/gitConfig + with: + email: ${{ secrets.IDEE_GH_EMAIL }} + - name: Retrieve Scripts + run: | + git clone https://github.com/forcedotcom/bundle-publish-scripts.git + - name: Update references for Publishing + run: | + node bundle-publish-scripts/scripts/update-references-in-vsce.js + node bundle-publish-scripts/scripts/update-bundle-configs-in-vsce.js + - name: Set NPM at the correct version for Lerna + run: npm install -g npm@9.8.1 + - run: npm install + - run: npm install -g shelljs && npm install -g lerna@5.5.4 + - run: rm -rf ./bundle-publish-scripts + - name: Create and Push the Release Branch + id: create_step + run: | + echo "Creating a beta release from branch main" + node scripts/create-release-branch.js + - id: result + run: echo "result=${{ job.status }}" >> $GITHUB_OUTPUT + - id: version + run: echo "version="$(node -pe "require('./packages/salesforcedx-vscode/package.json').version")"" >> $GITHUB_OUTPUT + - id: branch + run: echo "branch=release/v${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT + + run_build_and_test: + if: ${{ needs.create_branch.result == 'success' }} # Only run this if the previous job is successful + uses: ./.github/workflows/buildAndTest.yml + name: 'Run Build and Unit Test' + needs: create_branch + secrets: inherit + with: + branch: ${{needs.create_branch.outputs.branch}} + label: ${{needs.create_branch.outputs.version}} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 3f8c78307d..b8d9582711 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -4,6 +4,7 @@ on: workflows: - Nightly Build Develop - Test, Build, and Release + - Create and Test Beta Release Branch types: - completed @@ -87,7 +88,7 @@ jobs: runId: ${{ inputs.runId || github.event.workflow_run.id }} LWC_E2E_tests: - if: ${{ inputs.lwcE2ETests || github.event_name == 'workflow_run' }} + if: ${{ inputs.lwcE2ETests || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }} uses: ./.github/workflows/lwcE2E.yml secrets: inherit with: diff --git a/.github/workflows/publishBeta.yml b/.github/workflows/publishBeta.yml new file mode 100644 index 0000000000..564704e5bd --- /dev/null +++ b/.github/workflows/publishBeta.yml @@ -0,0 +1,68 @@ +name: Publish Beta to Github Only + +on: + workflow_call: + inputs: + runId: + description: 'Run ID of the workflow run that created the vsixes' + required: false + type: string + +jobs: + download_artifacts: + name: 'Checkout Version' + runs-on: ubuntu-latest + outputs: + RELEASE_VERSION: ${{ steps.getVersion.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: main + - name: Download extension vsixes + run: | + mkdir ./tmp-dir + gh run download ${{ inputs.runId }} -D ./tmp-dir + env: + GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} + - name: 'Confirm all downloaded files' + run: ls -R + working-directory: tmp-dir + - id: getVersion + run: | + version=$(basename "$(find ./tmp-dir -mindepth 1 -maxdepth 1 -type d)") + echo "::set-output name=version::$version" + create_git_tag: + name: 'Create and Tag Beta Release' + runs-on: ubuntu-latest + needs: download_artifacts + env: + VERSION: ${{ needs.download_artifacts.outputs.RELEASE_VERSION }} + EXTENSION_PATH: ./tmp-dir/${{ needs.download_artifacts.outputs.RELEASE_VERSION }} + + steps: + - uses: actions/checkout@v3 + with: + ref: release/v${{ env.VERSION }} + - name: Download extension vsixes + run: | + mkdir ./tmp-dir + gh run download ${{ inputs.runId }} -D ./tmp-dir + env: + GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} + - run: cp ./packages/salesforcedx-vscode/CHANGELOG.md ${{ env.EXTENSION_PATH }} + - uses: ./.github/actions/gitConfig + with: + email: ${{ secrets.IDEE_GH_EMAIL }} + - name: 'Create git tag to map to the Release Version' + run: | + git tag v${{ env.VERSION }} + git push origin v${{ env.VERSION }} + - name: 'Confirm all downloaded files' + run: ls -R + working-directory: ${{ env.EXTENSION_PATH }} + - name: 'Create Pre-Release and Attach VSIX Files' + run: gh release create v${{ env.VERSION }} **.vsix --title "Pre-Release v${{ env.VERSION }}" --notes-file CHANGELOG.md --prerelease + working-directory: ${{ env.EXTENSION_PATH }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package-lock.json b/package-lock.json index b243778aac..8cab051b9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37029,6 +37029,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -37068,6 +37069,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -37160,6 +37162,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-apex-debugger/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-apex-replay-debugger": { "version": "60.14.0", "license": "BSD-3-Clause", @@ -37187,6 +37198,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -37279,6 +37291,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-apex-replay-debugger/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-apex/node_modules/@esbuild/android-arm": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", @@ -37365,6 +37386,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-apex/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-apex/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -37480,6 +37510,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -37639,6 +37670,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-core/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-core/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -37714,6 +37754,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -37843,6 +37884,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-lightning/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-lightning/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -37896,6 +37946,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -38029,6 +38080,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-lwc/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-lwc/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -38089,6 +38149,7 @@ "cross-env": "5.2.0", "debounce": "^1.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.23.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -38566,6 +38627,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "packages/salesforcedx-vscode-soql/node_modules/esbuild-plugin-pino": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/esbuild-plugin-pino/-/esbuild-plugin-pino-2.1.1.tgz", + "integrity": "sha512-NdcTruRCq7tCv/vQENeGRmV0mK/54tvKWT5J2+tDaAdSX7TVUiykEbtZ0xDZA1rJfyzd5rx1G8TqwXv1zBlK5w==", + "dev": true, + "peerDependencies": { + "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" + } + }, "packages/salesforcedx-vscode-soql/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", diff --git a/packages/salesforcedx-vscode-apex-debugger/package.json b/packages/salesforcedx-vscode-apex-debugger/package.json index 0c0f4cde53..1130cf7475 100644 --- a/packages/salesforcedx-vscode-apex-debugger/package.json +++ b/packages/salesforcedx-vscode-apex-debugger/package.json @@ -42,6 +42,7 @@ "cross-env": "5.2.0", "esbuild": "^0.19.5", "eslint": "8.52.0", + "esbuild-plugin-pino": "^2.1.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.29.0", diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/package.json b/packages/salesforcedx-vscode-apex-replay-debugger/package.json index ed97318ead..8dd1e002ae 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/package.json +++ b/packages/salesforcedx-vscode-apex-replay-debugger/package.json @@ -47,6 +47,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", diff --git a/packages/salesforcedx-vscode-apex/package.json b/packages/salesforcedx-vscode-apex/package.json index 946c32b744..733a8553fb 100644 --- a/packages/salesforcedx-vscode-apex/package.json +++ b/packages/salesforcedx-vscode-apex/package.json @@ -48,6 +48,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", @@ -105,7 +106,6 @@ "@salesforce/apex-tmlanguage": "1.4.0", "@salesforce/core": "7.3.1", "@salesforce/source-tracking": "6.0.4", - "@salesforce/templates": "^60.1.2", "applicationinsights": "1.0.7", "shelljs": "0.8.5" }, diff --git a/packages/salesforcedx-vscode-core/package.json b/packages/salesforcedx-vscode-core/package.json index 38b964ec8f..c87dd62da5 100644 --- a/packages/salesforcedx-vscode-core/package.json +++ b/packages/salesforcedx-vscode-core/package.json @@ -59,6 +59,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", diff --git a/packages/salesforcedx-vscode-lightning/package.json b/packages/salesforcedx-vscode-lightning/package.json index 3252c0c4a7..4024f14602 100644 --- a/packages/salesforcedx-vscode-lightning/package.json +++ b/packages/salesforcedx-vscode-lightning/package.json @@ -45,6 +45,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", diff --git a/packages/salesforcedx-vscode-lwc/package.json b/packages/salesforcedx-vscode-lwc/package.json index 11e142843c..f9f527f842 100644 --- a/packages/salesforcedx-vscode-lwc/package.json +++ b/packages/salesforcedx-vscode-lwc/package.json @@ -53,6 +53,7 @@ "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", diff --git a/packages/salesforcedx-vscode-soql/package.json b/packages/salesforcedx-vscode-soql/package.json index 64a01c2fee..ae315261c0 100644 --- a/packages/salesforcedx-vscode-soql/package.json +++ b/packages/salesforcedx-vscode-soql/package.json @@ -61,6 +61,7 @@ "cross-env": "5.2.0", "debounce": "^1.2.0", "esbuild": "^0.19.5", + "esbuild-plugin-pino": "^2.1.0", "eslint": "8.23.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-header": "3.1.1", diff --git a/scripts/create-release-branch.js b/scripts/create-release-branch.js index eb097e59a0..c76bf51039 100755 --- a/scripts/create-release-branch.js +++ b/scripts/create-release-branch.js @@ -14,7 +14,7 @@ function getReleaseVersion() { .version; let [version, major, minor, patch] = currentVersion.match(/^(\d+)\.?(\d+)\.?(\*|\d+)$/); - switch(RELEASE_TYPE) { + switch (RELEASE_TYPE) { case 'major': major = parseInt(major) + 1; minor = 0; @@ -49,7 +49,9 @@ checkVSCodeVersion(); const nextVersion = process.env['SALESFORCEDX_VSCODE_VERSION']; logger.info(`Release version: ${nextVersion}`); -checkBaseBranch('develop'); +if (!isBetaRelease()) { + checkBaseBranch('develop'); +} const releaseBranchName = `release/v${nextVersion}`; @@ -95,6 +97,11 @@ shell.exec('git add package-lock.json'); // Add change to lerna.json shell.exec('git add lerna.json'); +// If it is a beta release, add all files +if (isBetaRelease()) { + shell.exec('git add .'); +} + // Git commit shell.exec(`git commit -m "chore: update to version ${nextVersion}"`);