-
Notifications
You must be signed in to change notification settings - Fork 401
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9036898
chore: implement workflow to publish beta release
mingxuanzhangsfdx 3b6060e
chore: fix the typo for LWC e2e tests
mingxuanzhangsfdx 0501c61
chore: apply reviewer's suggestion
mingxuanzhangsfdx 1f393e6
chore: refactor publish beta workflow
mingxuanzhangsfdx 22b2953
Merge branch 'develop' into mz/publish-beta-workflow
mingxuanzhangsfdx ffb9f91
Update .github/workflows/approveAndPublishBeta.yml
mingxuanzhangsfdx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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