55 branches :
66 - master
77 paths-ignore :
8+ - ' docs/**'
9+ - ' .vscode/**'
10+ - ' .github/**'
811 - ' *.md'
912 - ' **/*.md'
1013 pull_request :
1518 - created
1619jobs :
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
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
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/
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
0 commit comments