-
Notifications
You must be signed in to change notification settings - Fork 15
136 lines (117 loc) · 4.87 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# 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: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get version from tag
id: get_version
uses: battila7/get-version-action@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_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).
You can also install the extension manually by downloading the VSIX package included in this release and using:
```
code --install-extension galaxy-tools-${{ steps.get_version.outputs.version-without-v }}.vsix
```
draft: false
prerelease: false
outputs:
release_version: ${{ steps.get_version.outputs.version-without-v }}
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
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@v3
- name: Set up Python
uses: actions/setup-python@v4
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@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Clean install dependencies
run: |
npm ci
- name: Update version in package.json
uses: onlyutkarsh/[email protected]
with:
files: "${{github.workspace}}/client/package.json"
patch-syntax: |
= /version => "${{needs.prepare_release.outputs.release_version}}"
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
id: publishToOpenVSX
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
packagePath: "./client/"
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
packagePath: ""
- name: Upload vsix as artifact
uses: actions/upload-artifact@v3
with:
name: galaxy-tools-${{needs.prepare_release.outputs.release_version}}.vsix
path: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.release_upload_url }}
asset_path: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
asset_name: galaxy-tools-${{needs.prepare_release.outputs.release_version}}.vsix
asset_content_type: application/vsix