-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: implement the workflow to publish beta release for core-bundle (…
…#5603) * chore: implement workflow to publish beta release * chore: fix the typo for LWC e2e tests * chore: apply reviewer's suggestion * chore: refactor publish beta workflow * Update .github/workflows/approveAndPublishBeta.yml Co-authored-by: Cristina Cañizales <[email protected]> --------- Co-authored-by: Cristina Cañizales <[email protected]>
- Loading branch information
1 parent
2fd7fc4
commit 6586c4f
Showing
13 changed files
with
247 additions
and
4 deletions.
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 | ||
- 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 [email protected] | ||
- run: npm install | ||
- run: npm install -g shelljs && npm install -g [email protected] | ||
- 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.