Skip to content

Conversation

EhabY
Copy link
Collaborator

@EhabY EhabY commented Oct 14, 2025

- Automatically publish a pre-release version on every merge to main with the following versioning: MAJOR.(MINOR+1).YYYYMMDDNN. It means we can have up to 100 releases (merges to main) in a day. This is similar to how VS Code's Remote SSH does preview releases.

  • Automatically publish the pre-release when pushing a v*-pre tag to main.
  • Automatically publish the stable release when pushing a v* tag to main.
  • Both release workflows use the same publish-extension.yaml workflow for all publishing tasks (VS Marketplace, Open VSX, and GitHub releases), with the isPreRelease flag controlling the behavior.
  • Package VSIX on every PR and merge to main. For PRs, it is retained for 7 days, but for main it's retained indefinitely.

Notes

  • Set VSCE_PAT and OVSX_PAT secrets in repo, if not set, then the pipeline fails (we can add a check here but I prefer this to be explicit).

Closes #97

Comment on lines +87 to +93
name: extension-pr-${{ github.event.pull_request.number }}
path: ${{ steps.setup.outputs.packageName }}
if-no-files-found: error
retention-days: 7

- name: Upload artifact (main)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: extension-main-${{ github.sha }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could use better artifact name, does Coder have a standard for this?

Copy link
Member

Choose a reason for hiding this comment

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

No standard that I know of. Do we need to name this differently? We could just upload the vsix as it is already named. I like the coder-remote-$version-$sha.vsix scheme you have, we can use that name on all uploads IMO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the artifact name, apparently we cannot have individual files as artifacts (you can checkout the PR artifact here as well)

Copy link
Member

Choose a reason for hiding this comment

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

Ah right I forgot it forces you to zip it up.

@EhabY EhabY requested a review from code-asher October 15, 2025 12:55
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

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

Awesome!

Comment on lines +87 to +93
name: extension-pr-${{ github.event.pull_request.number }}
path: ${{ steps.setup.outputs.packageName }}
if-no-files-found: error
retention-days: 7

- name: Upload artifact (main)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: extension-main-${{ github.sha }}
Copy link
Member

Choose a reason for hiding this comment

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

No standard that I know of. Do we need to name this differently? We could just upload the vsix as it is already named. I like the coder-remote-$version-$sha.vsix scheme you have, we can use that name on all uploads IMO.

fi
publishGH:
name: Create GitHub ${{ inputs.isPreRelease && 'Pre-' || '' }}Release
Copy link
Member

Choose a reason for hiding this comment

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

Sooo....I know I said I liked the idea of symmetrical releases but since we might have to duplicate pre-releases to work around VS Code's jank I wonder if we only publish previews to the marketplaces and skip them on GH to keep GH free of dupes at least. Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was mistaken because of some caching issues, updating works fine from pre-release -> release -> pre-release (if I'm on the pre-release channel)

Comment on lines +10 to +13
packageName:
required: true
type: string
description: "Package filename"
Copy link
Member

Choose a reason for hiding this comment

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

Could we derive the package name from the version and pre-release inputs? I doubt this would actually happen, but it could be weird if you are able to pass 1.1.2 and false with the package name extension-5.4.3-pre for example.

Copy link
Collaborator Author

@EhabY EhabY Oct 16, 2025

Choose a reason for hiding this comment

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

We could yes but that means publish-extension.yaml has to be aware of the format of the package name, right now it just takes the name as is so there's no implicit info that is deduced.

Copy link
Member

@code-asher code-asher Oct 17, 2025

Choose a reason for hiding this comment

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

If we derive the name, we make it impossible for the template to be used incorrectly. It seems bad that the template allows you to publish a mismatched version and package (or pre-release a non-prerelease, etc).

We could do it the other way, extract the version and whether it is a pre-release from the package. But, if we ever have to kick this off manually, it would be nicer to type in the version to publish and check a box rather than type out the full package name.

@EhabY EhabY requested a review from code-asher October 17, 2025 08:33
EhabY added 5 commits October 17, 2025 22:38
* Publish pre-release extension on every push to main
* Upload VSIX to the VS Code Marketplace and Open VSX on tag push
* Publish pre-release on tag push "v*-pre"
@EhabY EhabY force-pushed the automatic-publish-extension branch from c1ac29d to d075fa9 Compare October 17, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate extension releases to VS Code Marketplace and Open VSX Regsitry

2 participants