Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: implement the workflow to publish beta release for core-bundle #5603

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/createAndTestBetaReleaseBranch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Create and Test Beta Release Branch

on:
workflow_dispatch:

jobs:
create_branch:
name: 'Create Branch'
runs-on: ubuntu-latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this will be tested only on Ubuntu. Any reason to omit Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildAndTest workflow tests linux and windows, this is just for the create branch job

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job 'create_branch' is only for branch creation. Testing is in the job run_build_and_test and e2e

outputs:
version: ${{ steps.version.outputs.version }}
branch: ${{ steps.branch.outputs.branch }}
result: ${{ steps.result.outputs.result }}
env:
RELEASE_TYPE: ${{ 'beta' }}
mingxuanzhangsfdx marked this conversation as resolved.
Show resolved Hide resolved

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
CristiCanizales marked this conversation as resolved.
Show resolved Hide resolved
- 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}}

confirm_publish:
CristiCanizales marked this conversation as resolved.
Show resolved Hide resolved
needs: run_build_and_test
environment: publish
runs-on: ubuntu-latest
if: ${{ needs.run_build_and_test.result == 'success' }} # Only run this if the previous job was successful
name: 'Confirm Publish Beta Release'
steps:
- run: echo "Please confirm to publish the beta release"

run_publish_beta_release:
needs: [confirm_publish, run_build_and_test, create_branch]
if: ${{ needs.confirm_publish.result == 'success' }}
name: 'Publish Beta Release'
uses: ./.github/workflows/publishBetaRelease.yml
with:
branch: ${{needs.create_branch.outputs.branch}}
secrets: inherit
3 changes: 2 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflows:
- Nightly Build Develop
- Test, Build, and Release
- Create and Test Beta Release Branch
types:
- completed

Expand Down Expand Up @@ -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') }}
mingxuanzhangsfdx marked this conversation as resolved.
Show resolved Hide resolved
uses: ./.github/workflows/lwcE2E.yml
secrets: inherit
with:
Expand Down
44 changes: 15 additions & 29 deletions .github/workflows/publishBetaRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,13 @@ name: Publish Beta Release to Github Only
on:
workflow_dispatch:

jobs:
save_artifacts:
name: 'Build VSIX Files'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.ref }}
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: npm install -g lerna
- run: npm install
- run: npm run compile
- run: npm run vscode:package
- name: Stage Artifacts
run: |
mkdir extensions
find packages -name "*.vsix" -type f -exec cp {} ./extensions \;
cp ./packages/salesforcedx-vscode/CHANGELOG.md ./extensions
- name: Upload Extensions
uses: actions/upload-artifact@v3
with:
name: VS Code Extensions
path: ./extensions/
workflow_call:
inputs:
branch:
type: string
required: true

jobs:
get_release_variables:
# store the RELEASE_VERSION from the parent package as an output that we can reference elsewhere
name: 'Get Release Environment Variables'
Expand All @@ -38,28 +18,34 @@ jobs:
RELEASE_VERSION: ${{ steps.getVersion.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch || github.event.ref }}
- id: getVersion
run: echo "::set-output name=version::"$(node -pe "require('./packages/salesforcedx-vscode/package.json').version")""
- run: echo "Release Version is ${{ steps.getVersion.outputs.version }}"

create_git_tag:
name: 'Create and Tag Beta Release'
runs-on: ubuntu-latest
needs: [save_artifacts, get_release_variables]
needs: [get_release_variables]
outputs:
version: ${{ steps.version.outputs.version }}
release_type: ${{ github.event.inputs.releaseType || 'minor' }}
release_type: ${{ 'beta' }}
result: ${{ steps.result.outputs.result }}
env:
VERSION: ${{ needs.get_release_variables.outputs.RELEASE_VERSION }}

steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch || github.event.ref }}
- uses: actions/download-artifact@v3
id: download
with:
name: VS Code Extensions
name: ${{ needs.get_release_variables.outputs.RELEASE_VERSION }}
path: tmp/saved-extensions
- run: |
cp ./packages/salesforcedx-vscode/CHANGELOG.md ./tmp/saved-extensions
- uses: ./.github/actions/gitConfig
with:
email: ${{ secrets.IDEE_GH_EMAIL }}
Expand Down
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/salesforcedx-vscode-apex-debugger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"cross-env": "5.2.0",
"esbuild": "^0.19.5",
"eslint": "8.52.0",
"esbuild-plugin-pino": "^2.1.0",
mingxuanzhangsfdx marked this conversation as resolved.
Show resolved Hide resolved
"eslint-config-prettier": "9.0.0",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.29.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/salesforcedx-vscode-apex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
mingxuanzhangsfdx marked this conversation as resolved.
Show resolved Hide resolved
"applicationinsights": "1.0.7",
"shelljs": "0.8.5"
},
Expand Down
1 change: 1 addition & 0 deletions packages/salesforcedx-vscode-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/salesforcedx-vscode-lightning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading
Loading