Skip to content

Commit 1960777

Browse files
authored
Merge pull request #57 from daimor/windows-builds
switch to windows builds for releases
2 parents 008203f + 4854eb9 commit 1960777

File tree

7 files changed

+298
-325
lines changed

7 files changed

+298
-325
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ jobs:
2323
strategy:
2424
matrix:
2525
os: [ubuntu-latest, windows-latest, macOS-latest]
26+
outputs:
27+
name: ${{ steps.set-version.outputs.name }}
28+
version: ${{ steps.set-version.outputs.version }}
2629
steps:
2730
- uses: actions/checkout@v2
2831
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2932
- name: Set an output
3033
id: set-version
31-
if: runner.os == 'Linux'
34+
if: runner.os == 'Windows'
35+
shell: bash
3236
run: |
3337
set -x
3438
VERSION=$(jq -r '.version' package.json | cut -d- -f1)
@@ -58,83 +62,59 @@ jobs:
5862
with:
5963
run: npm run test
6064
- name: Build package
61-
if: runner.os == 'Linux'
6265
run: |
6366
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
6467
- uses: actions/upload-artifact@v2
65-
if: runner.os == 'Linux'
68+
if: (runner.os == 'Windows') && (github.event_name != 'release')
6669
with:
6770
name: ${{ steps.set-version.outputs.name }}.vsix
6871
path: ${{ steps.set-version.outputs.name }}.vsix
69-
- uses: actions/upload-artifact@v2
70-
if: runner.os == 'Linux'
71-
with:
72-
name: meta
73-
path: |
74-
.name
75-
.version
7672
beta:
7773
if: (github.event_name == 'push')
78-
runs-on: ubuntu-latest
74+
runs-on: windows-latest
7975
needs: build
8076
steps:
8177
- uses: actions/download-artifact@v2
8278
with:
83-
name: meta
84-
path: .
85-
- name: Set an output
86-
id: set-version
87-
if: runner.os == 'Linux'
88-
run: |
89-
set -x
90-
echo ::set-output name=version::`cat .version`
91-
echo ::set-output name=name::`cat .name`
92-
- uses: actions/download-artifact@v2
93-
with:
94-
name: ${{ steps.set-version.outputs.name }}.vsix
79+
name: ${{ needs.test.outputs.name }}.vsix
9580
- name: Create Release
9681
id: create_release
9782
uses: actions/create-release@v1
98-
if: runner.os == 'Linux'
9983
env:
10084
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10185
with:
102-
tag_name: v${{ steps.set-version.outputs.version }}
103-
release_name: v${{ steps.set-version.outputs.version }}
86+
tag_name: v${{ needs.test.outputs.version }}
87+
release_name: v${{ needs.test.outputs.version }}
10488
prerelease: ${{ github.event_name != 'release' }}
10589
body: |
10690
Changes in this release
107-
${{ steps.set-version.outputs.changelog }}
91+
${{ needs.test.outputs.changelog }}
10892
- name: Upload Release Asset
10993
id: upload-release-asset
11094
uses: actions/upload-release-asset@v1
111-
if: runner.os == 'Linux'
11295
env:
11396
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11497
with:
11598
upload_url: ${{ steps.create_release.outputs.upload_url }}
116-
asset_path: ${{ steps.set-version.outputs.name }}.vsix
117-
asset_name: ${{ steps.set-version.outputs.name }}.vsix
99+
asset_path: ${{ needs.test.outputs.name }}.vsix
100+
asset_name: ${{ needs.test.outputs.name }}.vsix
118101
asset_content_type: application/zip
119102
publish:
120103
if: github.event_name == 'release'
121-
runs-on: ubuntu-latest
104+
runs-on: windows-latest
122105
needs: build
123106
steps:
124107
- uses: actions/checkout@v2
125108
with:
126109
ref: master
127110
token: ${{ secrets.TOKEN }}
128-
- uses: actions/download-artifact@v2
129-
with:
130-
name: meta
131-
path: .
132111
- name: Use Node.js
133112
uses: actions/setup-node@v1
134113
with:
135114
node-version: 12.x
136115
- name: Prepare build
137116
id: set-version
117+
shell: bash
138118
run: |
139119
VERSION=`cat .version`
140120
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
@@ -155,7 +135,6 @@ jobs:
155135
- name: Upload Release Asset
156136
id: upload-release-asset
157137
uses: actions/upload-release-asset@v1
158-
if: runner.os == 'Linux'
159138
env:
160139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161140
with:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
node_modules/
33
out/
4-
*.vsix
4+
.vscode-test
5+
*.vsix

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"outFiles": [
4646
"${workspaceFolder}/out/test/**/*.js"
4747
],
48-
"preLaunchTask": "npm: watch"
48+
"preLaunchTask": "npm: compile"
4949
}
5050
]
5151
}

0 commit comments

Comments
 (0)