diff --git a/.github/actions/gitConfig/action.yml b/.github/actions/gitConfig/action.yml new file mode 100644 index 0000000000..4e1766afdc --- /dev/null +++ b/.github/actions/gitConfig/action.yml @@ -0,0 +1,17 @@ +name: gitConfig +description: "Sets git username/email and push behavior" + +inputs: + email: + description: 'Email to set for config' + required: true + +runs: + using: composite + steps: + - run: git config --global push.default current + shell: bash + - run: git config --global user.email ${{ inputs.email }} + shell: bash + - run: git config user.name 'Release Bot' + shell: bash \ No newline at end of file diff --git a/.github/workflows/publish-beta-release.yml b/.github/workflows/publish-beta-release.yml new file mode 100644 index 0000000000..569ad1cf49 --- /dev/null +++ b/.github/workflows/publish-beta-release.yml @@ -0,0 +1,73 @@ +name: Publish Beta Release to Github Only + +on: + workflow_dispatch: + +jobs: + save_artifacts: + name: 'Build VSIX Files' + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-node@v1 + with: + node-version: latest + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.ref }} + - 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/ + + get_release_variables: + # store the RELEASE_VERSION from the parent package as an output that we can reference elsewhere + name: 'Get Release Environment Variables' + runs-on: ubuntu-latest + outputs: + RELEASE_VERSION: ${{ steps.getVersion.outputs.version }} + steps: + - uses: actions/checkout@v3 + - 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] + env: + VERSION: ${{ needs.get_release_variables.outputs.RELEASE_VERSION }} + + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + id: download + with: + name: VS Code Extensions + path: tmp/saved-extensions + - uses: ./.github/actions/gitConfig + with: + email: ${{ secrets.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: tmp/saved-extensions + - 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: tmp/saved-extensions + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/contributing/publishing.md b/contributing/publishing.md index da228a1842..fb7ebf7823 100644 --- a/contributing/publishing.md +++ b/contributing/publishing.md @@ -72,6 +72,23 @@ After the pre-publish steps have run and main has been rebased off of the releas --- +# Publishing a Beta Pre-Release + +If there is a release with high-risk or large-scale changes, we can publish a pre-release to allow advanced users to test early. VSIX artifacts are uploaded to a github release as with our usual release but there is no publish to NPM or the VS Code Marketplace (yet). + +## Steps + +1. Create a release branch, and increment the version using Lerna, as shown in the `create-release-branch.js` file, starting at the creation of the release branch. +2. For the version number, keep the minor version the same and set the patch to use the following format: year month day hour minute. For example, v55.11.202208260522. +3. Push the branch to remote. +4. From the Actions tab in Github select the workflow 'Publish Beta Release to Github Only'. +5. Select 'Run Workflow', and run the workflow from the beta branch. The workflow can only be run someone with write privileges of this repo. +6. The workflow will create the git tag, the release, and attach the individual VSIX files to the release where they can be downloaded and tested. + +Note that the beta branch, because of the unique versioning, should not be merged back to develop. When the code is ready for a standard release, the regular release branching process should be followed. + +--- + # Manual Publish In the event that CircleCI is not a viable option for publishing, see the following...