-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (72 loc) · 2.85 KB
/
publish-workflow.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: relax-a-little
on:
push:
branches:
- main
paths-ignore: # dont run when changes made to these folders
- ".vscode/**"
jobs:
cicd:
name: cicd
runs-on: windows-latest
steps:
- name: checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: fetch all history and tags from all branches for gitversion
run: |
git fetch --prune
git fetch --tags
- name: install gitversion tool
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: "5.x"
- name: execute gitversion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
- name: print gitversion
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
- name: setup node
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: clean install dependencies
run: npm run ci
- name: update metadata in package.json
uses: onlyutkarsh/patch-files-action@v1.0.1
with:
files: "${{github.workspace}}/package.json"
patch-syntax: |
= /version => "${{ steps.gitversion.outputs.semVer }}"
= /displayName => "relax a little"
= /description => "this extension provides tools to relax like giving reminders to look somewhere else, drink water, walk or do some lunges. comes with lot of configurations to control time of reminder, interval, water drinking intervals and more."
- name: add version in CHANGELOG.md
uses: cschleiden/replace-tokens@v1.0
with:
files: "${{github.workspace}}/CHANGELOG.md"
env:
VERSION: "${{ steps.gitversion.outputs.semVer }}"
- name: compile and create vsix
run: npm run package
- name: upload vsix as artifact
uses: actions/upload-artifact@v1
with:
name: relax-a-little-${{steps.gitversion.outputs.semVer}}.vsix
path: ${{github.workspace}}/relax-a-little-${{steps.gitversion.outputs.semVer}}.vsix
- name: publish to marketplace
if: github.ref == 'refs/heads/main'
run: npm run deploy ${{ secrets.PAT }}
- name: create a release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ steps.gitversion.outputs.semVer }}
release_name: v${{ steps.gitversion.outputs.semVer }}