-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (83 loc) · 3.08 KB
/
Copy pathci.yml
File metadata and controls
99 lines (83 loc) · 3.08 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI
on:
push:
branches:
- main
paths-ignore: # dont run when changes made to these folders
- '.vscode/**'
pull_request: {}
workflow_dispatch:
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm prettier . --check
package:
name: Package
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- name: fetch all history and tags from all branches for gitversion
run: git fetch --prune --unshallow
- uses: actions/setup-dotnet@v4
- name: install gitversion tool
uses: gittools/actions/gitversion/setup@v3.2.0
- name: execute gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v3.2.0
- 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: 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.majorMinorPatch }}"
- name: add version in CHANGELOG.md
uses: cschleiden/replace-tokens@v1.0
with:
files: '${{github.workspace}}/CHANGELOG.md'
env:
VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}"
- name: compile and create vsix
run: pnpm vs:package
- name: upload vsix as artifact
uses: actions/upload-artifact@v4
with:
name: emberjs-snippets-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
path: ${{github.workspace}}/emberjs-snippets-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
- name: create a release
if: github.ref == 'refs/heads/main'
continue-on-error: false
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 }}
- name: publish to marketplace VSCODE
if: github.ref == 'refs/heads/main'
env:
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN }}
run: pnpm vs:publish:ci
continue-on-error: true
- name: publish to marketplace OPEN VSX
if: github.ref == 'refs/heads/main'
env:
OPENVSX_TOKEN: ${{ secrets.OPENVSX_TOKEN }}
run: pnpm ov:publish:ci
continue-on-error: true