Skip to content

Commit 8a814ed

Browse files
Merge pull request #17 from intersystems-community/workflow_changes
several changes to workflow file
2 parents 0174b12 + a38ce9e commit 8a814ed

File tree

3 files changed

+65
-20
lines changed

3 files changed

+65
-20
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77
paths-ignore:
8+
- 'docs/**'
9+
- '.vscode/**'
10+
- '.github/**'
811
- '*.md'
912
- '**/*.md'
1013
pull_request:
@@ -15,12 +18,13 @@ on:
1518
- created
1619
jobs:
1720
build:
21+
timeout-minutes: 10
1822
runs-on: ${{ matrix.os }}
1923
strategy:
2024
matrix:
2125
os: [ubuntu-latest, windows-latest, macOS-latest]
2226
steps:
23-
- uses: actions/checkout@master
27+
- uses: actions/checkout@v2
2428
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2529
- name: Set an output
2630
id: set-version
@@ -34,7 +38,7 @@ jobs:
3438
echo ::set-output name=changelog::$CHANGELOG
3539
git tag -l | cat
3640
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
37-
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev
41+
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
3842
echo ::set-output name=version::$VERSION
3943
NAME=$(jq -r '.name' package.json)-$VERSION
4044
echo ::set-output name=name::$NAME
@@ -44,7 +48,7 @@ jobs:
4448
echo $VERSION > ./dist/.version
4549
echo $NAME > ./dist/.name
4650
- name: Use Node.js
47-
uses: actions/setup-node@master
51+
uses: actions/setup-node@v1
4852
with:
4953
node-version: 12.x
5054
- run: npm install
@@ -56,18 +60,18 @@ jobs:
5660
- name: Build package
5761
if: runner.os == 'Linux'
5862
run: |
59-
./node_modules/.bin/vsce package -o ./dist/package.vsix
60-
- uses: actions/upload-artifact@master
63+
./node_modules/.bin/vsce package -o ./dist/${{ steps.set-version.outputs.name }}.vsix
64+
- uses: actions/upload-artifact@v2
6165
if: runner.os == 'Linux'
6266
with:
6367
name: vsix
64-
path: ./dist/
68+
path: ./dist/${{ steps.set-version.outputs.name }}.vsix
6569
beta:
6670
if: (github.event_name == 'push')
6771
runs-on: ubuntu-latest
6872
needs: build
6973
steps:
70-
- uses: actions/download-artifact@master
74+
- uses: actions/download-artifact@v2
7175
with:
7276
name: vsix
7377
path: ./dist/
@@ -80,7 +84,7 @@ jobs:
8084
echo ::set-output name=name::`cat ./dist/.name`
8185
- name: Create Release
8286
id: create_release
83-
uses: actions/create-release@master
87+
uses: actions/create-release@v1
8488
if: runner.os == 'Linux'
8589
env:
8690
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -93,13 +97,13 @@ jobs:
9397
${{ steps.set-version.outputs.changelog }}
9498
- name: Upload Release Asset
9599
id: upload-release-asset
96-
uses: actions/upload-release-asset@master
100+
uses: actions/upload-release-asset@v1
97101
if: runner.os == 'Linux'
98102
env:
99103
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100104
with:
101105
upload_url: ${{ steps.create_release.outputs.upload_url }}
102-
asset_path: ./dist/package.vsix
106+
asset_path: ./dist/${{ steps.set-version.outputs.name }}.vsix
103107
asset_name: ${{ steps.set-version.outputs.name }}.vsix
104108
asset_content_type: application/zip
105109
publish:
@@ -110,12 +114,12 @@ jobs:
110114
- uses: actions/checkout@v2
111115
with:
112116
ref: master
113-
- uses: actions/download-artifact@master
117+
- uses: actions/download-artifact@v2
114118
with:
115119
name: vsix
116120
path: ./dist/
117121
- name: Use Node.js
118-
uses: actions/setup-node@master
122+
uses: actions/setup-node@v1
119123
with:
120124
node-version: 12.x
121125
- name: Prepare build
@@ -133,21 +137,22 @@ jobs:
133137
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
134138
jq '.enableProposedApi = false' package.json > "$tmp" && mv "$tmp" package.json
135139
npm install
136-
npm i -g vsce ovsx
137140
git push
138141
- name: Upload Release Asset
139142
id: upload-release-asset
140-
uses: actions/upload-release-asset@master
143+
uses: actions/upload-release-asset@v1
141144
if: runner.os == 'Linux'
142145
env:
143146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144147
with:
145148
upload_url: ${{ github.event.release.upload_url }}
146-
asset_path: ./dist/package.vsix
149+
asset_path: ./dist/${{ steps.set-version.outputs.name }}.vsix
147150
asset_name: ${{ steps.set-version.outputs.name }}.vsix
148151
asset_content_type: application/zip
149-
- name: Publish to Marketplaces
152+
- name: Publish to VSCode Marketplace
153+
run: |
154+
[ -n "${{ secrets.VSCE_TOKEN }}" ] && ./node_modules/.bin/vsce publish -p ${{ secrets.VSCE_TOKEN }} || true
155+
- name: Publish to Open VSX Registry
150156
run: |
151-
vsce publish -p ${{ secrets.VSCE_TOKEN }}
152-
ovsx publish --pat ${{ secrets.OVSX_TOKEN }}
157+
[ -n "${{ secrets.OVSX_TOKEN }}" ] && ./node_modules/.bin/ovsx publish --pat ${{ secrets.OVSX_TOKEN }} || true
153158

package-lock.json

Lines changed: 40 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@
4545
},
4646
"devDependencies": {
4747
"@types/glob": "^7.1.1",
48+
"@types/keytar": "^4.4.2",
4849
"@types/mocha": "^5.2.6",
4950
"@types/node": "^8.10.60",
50-
"@types/keytar": "^4.4.2",
5151
"glob": "^7.1.6",
5252
"mocha": "^7.1.2",
53+
"ovsx": "latest",
5354
"ts-loader": "^6.2.2",
5455
"tslint": "^5.20.1",
5556
"typescript": "^3.8.3",

0 commit comments

Comments
 (0)