vscode-terraform
vscode-terraform copied to clipboard
Add OpenVSX publishing
This is a succession to https://github.com/hashicorp/vscode-terraform/pull/388, which adapts publishing to OpenVSX embedded in the publishing workflow in GitHub Actions.
Fixes #379
Before using this it is necessary to set up an OVSX_PAT GitHub Action secret with the value from open-vsx.org/user-settings/tokens. A claim of the hashicorp namespace will be also required (this can be done by submitting an issue in the OpenVSX repo).
Hey @radeksimko, thanks for the quick review!
Would you mind signing the CLA?
Working on that :)
Would you mind decoupling the OpenVSX into a separate job?
I would not at all, but maybe we could implement something a bit different which would wouldn't require its own step. We could essentially have the setup I made, but we would use if: always() on the OpenVSX step so that these two registries publish independently without having a successful publish to the other one.
the two publishing jobs can run in parallel
This is a fair point that would not work with the approach I'm proposing, but I think the ~30 seconds it takes the job to publish all of the extension versions could be tolerated because the GitHub Actions runners often have different boot times (hence this approach could be faster sometimes, and sometimes slower).
So the main benefit of splitting it into its own job is that GitHub allows us to rerun a failed job, but we cannot rerun individual steps unfortunately.

So let's say that OpenVSX publishing fails and Marketplace succeeds - if we had both as steps - we'd have to retry both, or have some extra logic to ensure that repeated publishing to the Marketplace is harmless. More likely we just wouldn't retry.
but we would use if: always() on the OpenVSX step so that these two registries publish independently without having a successful publish to the other one.
Right, I wasn't entirely clear but this is the main benefit I had in mind when talking about parallel jobs, more than the time saved. I think the two jobs can still be independent of each other and both use something like this?
needs: build
if: success() && startsWith( github.ref, 'refs/tags/v')
I think the two jobs can still be independent of each other and both use something like this?
I think so as well.
All other comments sound fair, I will add it as a separate job just like the MS publish. ~~My main concern here was just duplicate workflow code, but that could perhaps be addressed in a future PR with moving some steps into their own .yml files.~~
Update: just realized there will be close to no duplicate code, I thought we would have to create a whole new workflow 🤦 😄.
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.