Refactor release workflow and remove version action #35
Workflow file for this run
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
# Creates a release from a tag with the name "v[mayor].[minor].[patch]" and then publishes the language server to PyPI | |
# and the extension to Open-VSX and VSCode Marketplace. | |
name: Publish Release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
prepare_release: | |
name: Prepare Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- run: npm ci | |
- name: Package Extension | |
id: packageExtension | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: stub | |
packagePath: "./client/" | |
dryRun: true | |
- name: Create Draf Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: Release ${{ github.ref }} | |
body: | | |
This release contains the [Galaxy Language Server](https://github.com/davelopez/galaxy-language-server/tree/main/server) and the [Galaxy Tools Visual Studio Code Extension](https://github.com/davelopez/galaxy-language-server/tree/main/client). | |
You can view the list of changes in the respective changelogs: | |
- Galaxy Language Server [changelog](https://github.com/davelopez/galaxy-language-server/blob/main/server/CHANGELOG.md) | |
- Galaxy Tools Visual Studio Extension [changelog](https://github.com/davelopez/galaxy-language-server/blob/main/client/CHANGELOG.md#) | |
The standalone version of the language server is available as a [PyPI package](https://pypi.org/project/galaxy-language-server/). | |
The Galaxy Tools Extension is available at [Open VSX Registry](https://open-vsx.org/extension/davelopez/galaxy-tools) and [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=davelopez.galaxy-tools). | |
draft: true | |
prerelease: false | |
generate_release_notes: true | |
files: ${{ steps.packageExtension.outputs.vsixPath }} | |
outputs: | |
release_upload_url: ${{ steps.create_release.outputs.upload_url }} | |
vsixPath: ${{ steps.packageExtension.outputs.vsixPath }} | |
publish-server: | |
name: Publish Language Server to PyPI | |
needs: prepare_release | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: server | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install Tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Package and Upload to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload --skip-existing dist/* | |
publish-client: | |
name: Publish extension to Open-VSX and VSCode Marketplace | |
needs: prepare_release | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: client | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: ${{ needs.prepare_release.outputs.vsixPath}} | |
- name: Publish to Open VSX Registry | |
uses: HaaLeo/publish-vscode-extension@v1 | |
id: publishToOpenVSX | |
with: | |
pat: ${{ secrets.OPEN_VSX_TOKEN }} | |
extensionFile: ${{ needs.prepare_release.outputs.vsixPath}} |