-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 1.57 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Main
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: echo "@matthewbill:registry=https://npm.pkg.github.com" >> .npmrc
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- run: echo "always-auth=true" >> .npmrc
# Ensure .npmrc file created correctly.
- run: cat .npmrc
- run: npm ci --ignore-scripts
# Run Tests
# - run: npm test
# Run Linting
- run: npm run lint
# Run JsDoc
- run: npm run docs
# Setup Git
- run: git config user.name "GitHub Actions"
- run: git config user.email "actions@github.com"
# Version
- run: npm version patch --git-tag-version false # git-tag-version is false to stop automatic commit without [skip ci] message to stop inifinite build loop
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- run: echo ${{ steps.package-version.outputs.current-version}}
- run: git add package.json
- run: git commit -m "[skip ci]"
# Build Artefacts
- run: npm install @vscode/vsce -g
- run: vsce package
# Push Artefacts
# Push to VSCE
- run: vsce publish -p ${{ secrets.AZURE_TOKEN }}
# Commit Version
- run: git push
- run: git tag ${{ steps.package-version.outputs.current-version}}
- run: git push --tags