Skip to content

Commit e3ca457

Browse files
authored
Make the 'build vsix' composite action reference other actions (microsoft#17257)
1 parent d2350cd commit e3ca457

3 files changed

Lines changed: 44 additions & 51 deletions

File tree

.github/actions/build-vsix/action.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
name: 'Build VSIX'
22
description: "Build the extension's VSIX"
33

4-
outputs:
5-
path:
6-
description: 'Path to the VSIX'
7-
value: 'ms-python-insiders.vsix'
4+
inputs:
5+
node_version:
6+
description: 'Version of Node to install'
7+
required: true
8+
vsix_name:
9+
description: 'Name to give the final VSIX'
10+
required: true
11+
artifact_name:
12+
description: 'Name to give the artifact containing the VSIX'
13+
required: true
814

915
runs:
1016
using: 'composite'
1117
steps:
18+
- name: Install Node
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ inputs.node_version }}
22+
23+
# Jedi LS depends on dataclasses which is not in the stdlib in Python 3.6.
24+
- name: Use Python 3.6 for JediLSP
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.6
28+
1229
- name: Upgrade Pip
1330
run: python -m pip install -U pip
1431
shell: bash
@@ -51,3 +68,16 @@ runs:
5168
- name: Build VSIX
5269
run: npm run package
5370
shell: bash
71+
72+
- name: Rename VSIX
73+
# Move to a temp name in case the specified name happens to match the default name.
74+
run: mv ms-python-insiders.vsix ms-python-temp.vsix && mv ms-python-temp.vsix ${{ inputs.vsix_name }}
75+
shell: bash
76+
77+
- name: Upload VSIX
78+
uses: actions/upload-artifact@v2
79+
with:
80+
name: ${{ inputs.artifact_name }}
81+
path: ${{ inputs.vsix_name }}
82+
if-no-files-found: error
83+
retention-days: 7

.github/workflows/build.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,20 @@ jobs:
4242
print(f"::set-output name=vsix_artifact_name::ms-python-{vsix_type}-vsix")
4343
4444
build-vsix:
45-
name: Build VSIX
45+
name: Create VSIX
4646
if: github.repository == 'microsoft/vscode-python'
4747
needs: setup
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout
51-
uses: actions/checkout@v2.3.4
52-
53-
- name: Install Node
54-
uses: actions/setup-node@v2.4.0
55-
with:
56-
node-version: ${{env.NODE_VERSION}}
57-
58-
# Jedi LS depends on dataclasses which was a pypi install in 3.6
59-
- name: Use Python 3.6 for JediLSP
60-
uses: actions/setup-python@v2
61-
with:
62-
python-version: 3.6
51+
uses: actions/checkout@v2
6352

6453
- name: Build VSIX
6554
uses: ./.github/actions/build-vsix
66-
id: build-vsix
67-
68-
- name: Rename VSIX
69-
if: steps.build-vsix.outputs.path != needs.setup.outputs.vsix_name
70-
run: mv ${{ steps.build-vsix.outputs.path }} ${{ needs.setup.outputs.vsix_name }}
71-
72-
- uses: actions/upload-artifact@v2
7355
with:
74-
name: ${{ needs.setup.outputs.vsix_artifact_name }}
75-
path: ${{ needs.setup.outputs.vsix_name }}
76-
if-no-files-found: error
77-
retention-days: 14
56+
node_version: ${{ env.NODE_VERSION }}
57+
vsix_name: ${{ needs.setup.outputs.vsix_name }}
58+
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}
7859

7960
lint:
8061
name: Lint

.github/workflows/pr-check.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,18 @@ env:
2121

2222
jobs:
2323
build-vsix:
24-
name: Build VSIX
24+
name: Create VSIX
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v2.3.4
29-
30-
- name: Install Node
31-
uses: actions/setup-node@v2.4.0
32-
with:
33-
node-version: ${{env.NODE_VERSION}}
34-
35-
# Jedi LS depends on dataclasses which was a pypi install in 3.6
36-
- name: Use Python 3.6 for JediLSP
37-
uses: actions/setup-python@v2
38-
with:
39-
python-version: 3.6
28+
uses: actions/checkout@v2
4029

4130
- name: Build VSIX
4231
uses: ./.github/actions/build-vsix
43-
id: build-vsix
44-
45-
- name: Rename VSIX
46-
if: steps.build-vsix.outputs.path != env.VSIX_NAME
47-
run: mv ${{ steps.build-vsix.outputs.path }} ${{ env.VSIX_NAME }}
48-
49-
- uses: actions/upload-artifact@v2
5032
with:
51-
name: ${{env.ARTIFACT_NAME_VSIX}}
52-
path: ${{env.VSIX_NAME}}
53-
retention-days: 7
33+
node_version: ${{ env.NODE_VERSION}}
34+
vsix_name: ${{ env.VSIX_NAME }}
35+
artifact_name: ${{ env.ARTIFACT_NAME_VSIX }}
5436

5537
lint:
5638
name: Lint

0 commit comments

Comments
 (0)