Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA to publish VSIX package #34

Merged
merged 2 commits into from
Jun 30, 2023
Merged

Conversation

khawkins
Copy link
Collaborator

I haven't been able to test the final (publishing) step, for obvious reasons. But I've tested the rest, by substituting the final step with a step that unzips the downloaded package and lists its contents, ensuring that we are in fact downloading a valid package from our release.

@khawkins khawkins requested a review from a team as a code owner June 30, 2023 17:29
@khawkins
Copy link
Collaborator Author

At a high level, this manual workflow goes like this:

  1. User goes to the Actions tab, selects the "Publish Extension Package for GitHub Release" action.
  2. They click the "Run workflow" button, which will ask for "Release Tag Name / Version". Our release tags are formatted as vx.y.z, but the input will allow for either that or just the version (i.e. x.y.z).
  3. The script will validate the tag format (errors out if it's invalid), then attempt to interrogate a Release associated with that tag name. Errors out if that Release does not exist.
  4. It will then grab the well-known VSIX package name asset associated with that release. Errors out if that asset does not exist.
  5. Finally, it will publish the VSIX package.

throw new Error(`'${tagNameValue}' is not a valid version string.`);
}

// Put the 'v' back on, as our release tags are formatted as 'v'x.y.z.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice comments!

Copy link
Collaborator

@dbreese dbreese left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@sfdctaka sfdctaka left a comment

Choose a reason for hiding this comment

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

LGTM!

@khawkins khawkins merged commit 200fb42 into salesforce:main Jun 30, 2023
8 checks passed
@khawkins khawkins deleted the publish_package branch June 30, 2023 20:13
env:
VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}
run: |
npx vsce publish -p ${{ env.VSCE_PERSONAL_ACCESS_TOKEN }} --packagePath ${{ steps.get_package_name.outputs.result }}

Choose a reason for hiding this comment

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

heh... a lot of this GHA flow is new to me...so LGTM!

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.

4 participants