Skip to content

Commit cae07da

Browse files
Dmitry MaslennikovDmitry Maslennikov
Dmitry Maslennikov
authored and
Dmitry Maslennikov
committed
update github workflow
1 parent 1453f9b commit cae07da

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

Diff for: .github/workflows/main.yml

+28-5
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,42 @@ jobs:
1919
- name: Use Node.js
2020
uses: actions/setup-node@master
2121
with:
22-
version: 10
22+
node-version: 10
2323
- run: npm install
2424
- run: npm run compile
2525
- run: npm run test
2626
env:
2727
DISPLAY: :10
28+
- name: Set an output
29+
id: get-version
30+
if: runner.os == 'Linux'
31+
run: |
32+
echo ::set-output name=version::$(jq -r '.version' package.json | cut -d- -f1)-B$(date -u "+%Y%m%d")
33+
echo ::set-output name=name::$(jq -r '.name+"-"+.version' package.json | cut -d- -f1-3)-B$(date -u "+%Y%m%d")
2834
- name: Build package
2935
if: runner.os == 'Linux'
3036
run: |
3137
mkdir dist
32-
./node_modules/.bin/vsce package -o ./dist/$(jq -r '.name + "-" + .version' package.json).vsix
33-
- uses: actions/upload-artifact@master
38+
./node_modules/.bin/vsce package -o ./dist/${{ steps.get-version.outputs.name }}.vsix
39+
- name: Create Release
40+
id: create_release
41+
uses: actions/create-release@v1
42+
if: runner.os == 'Linux'
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
tag_name: v${{ steps.get-version.outputs.version }}
47+
release_name: v${{ steps.get-version.outputs.version }}
48+
draft: false
49+
prerelease: true
50+
- name: Upload Release Asset
51+
id: upload-release-asset
52+
uses: actions/[email protected]
3453
if: runner.os == 'Linux'
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3556
with:
36-
name: vscode-objectscript
37-
path: dist
57+
upload_url: ${{ steps.create_release.outputs.upload_url }}
58+
asset_path: ./dist/${{ steps.get-version.outputs.name }}.vsix
59+
asset_name: ${{ steps.get-version.outputs.name }}.vsix
60+
asset_content_type: application/zip

0 commit comments

Comments
 (0)