Release #155
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
name: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: | | |
yarn install --frozen-lockfile | |
- name: Update Segment | |
run: | | |
set -e | |
setSegmentKey="setpath([\"segmentKey\"]; \"untrusted-dummy-key\")" | |
setConfigcatKey="setpath([\"configcatKey\"]; \"gitpod\")" | |
jqCommands="${setSegmentKey} | ${setConfigcatKey}" | |
cat package.json | jq "${jqCommands}" > package.json.tmp | |
mv package.json.tmp package.json | |
- name: Generate package.json | |
run: | | |
set -e | |
node ./scripts/prepare-release-build.js | |
mv package.release.json package.json | |
- name: Package extension | |
id: package_vsix | |
run: | | |
yarn package | |
echo ::set-output name=vsix_path::$(ls *.vsix) | |
version=$(jq --raw-output '.version' package.json) | |
echo ::set-output name=version::$version | |
- name: Ensure new version | |
run: | | |
latest_tag=$(curl --silent -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/gitpod-io/gitpod-vscode-desktop/releases/latest | jq --raw-output '.tag_name') | |
if [ "$latest_tag" = "v${{ steps.package_vsix.outputs.version }}" ]; then | |
exit 1 | |
fi | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.package_vsix.outputs.version }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: ${{ steps.package_vsix.outputs.vsix_path }} | |
- name: Publish to MS Marketplace | |
run: | | |
npx vsce publish --packagePath ${{ steps.package_vsix.outputs.vsix_path }} | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- name: Publish to Open VSX Registry | |
run: | | |
npx ovsx publish --packagePath ${{ steps.package_vsix.outputs.vsix_path }} | |
env: | |
OVSX_PAT: ${{ secrets.OPEN_VSX_PAT }} | |
- name: Update Action Summary | |
run: | | |
echo "Successfully released the \`gitpod-vscode-desktop\` extension (\`gitpod.gitpod-desktop\`) with the version: \`v${{ steps.package_vsix.outputs.version }}\`" >> summary.md | |
echo "" >> summary.md | |
echo "SHA: ${{ github.sha }}" >> summary.md | |
echo "Hub URL: https://marketplace.visualstudio.com/manage/publishers/gitpod/extensions/gitpod-desktop/hub" >> summary.md | |
echo "Extension URL: https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-desktop" >> summary.md | |
cat summary.md >> $GITHUB_STEP_SUMMARY |