Skip to content

Commit

Permalink
update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Maslennikov authored and Dmitry Maslennikov committed Dec 20, 2019
1 parent 1453f9b commit cae07da
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,42 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@master
with:
version: 10
node-version: 10
- run: npm install
- run: npm run compile
- run: npm run test
env:
DISPLAY: :10
- name: Set an output
id: get-version
if: runner.os == 'Linux'
run: |
echo ::set-output name=version::$(jq -r '.version' package.json | cut -d- -f1)-B$(date -u "+%Y%m%d")
echo ::set-output name=name::$(jq -r '.name+"-"+.version' package.json | cut -d- -f1-3)-B$(date -u "+%Y%m%d")
- name: Build package
if: runner.os == 'Linux'
run: |
mkdir dist
./node_modules/.bin/vsce package -o ./dist/$(jq -r '.name + "-" + .version' package.json).vsix
- uses: actions/upload-artifact@master
./node_modules/.bin/vsce package -o ./dist/${{ steps.get-version.outputs.name }}.vsix
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: runner.os == 'Linux'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get-version.outputs.version }}
release_name: v${{ steps.get-version.outputs.version }}
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
if: runner.os == 'Linux'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: vscode-objectscript
path: dist
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ steps.get-version.outputs.name }}.vsix
asset_name: ${{ steps.get-version.outputs.name }}.vsix
asset_content_type: application/zip

0 comments on commit cae07da

Please sign in to comment.