add package step to gh actions

This commit is contained in:
2021-12-07 11:35:44 +03:00
parent 7e8621f6b2
commit 926b050a63

View File

@@ -29,3 +29,33 @@ jobs:
- run: npm run lint
env:
DISPLAY: ":99.0"
package:
runs-on: ubuntu-latest
needs: lint
name: Package
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- run: npm install
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install -g vsce
- run: vsce package
- run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV
- run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
path: ${{ env.VSIX_PATH }}
name: ${{ env.VSIX_NAME }}