-
Notifications
You must be signed in to change notification settings - Fork 172
88 lines (73 loc) · 2 KB
/
build.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
86
87
88
name: Extension CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
release:
types:
- published
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Install NPM packages
run: npm install
- name: Build VSIX
run: make
- name: Set VSIX name variable
id: vsix_name
run: echo "::set-output name=filename::$(ls mono-debug-*.vsix)"
- name: Run tests
uses: GabrielBB/[email protected]
with:
run: make run-tests
- name: Upload CI VSIX
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: mono-debug-${{ github.sha }}.vsix
path: ${{ steps.vsix_name.outputs.filename }}
- name: Create Release
if: success() && startsWith(github.ref, 'refs/tags/v')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release VSIX
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.vsix_name.outputs.filename }}
asset_name: ${{ steps.vsix_name.outputs.filename }}
asset_content_type: application/zip
- name: Publish to VS Marketplace
if: success() && startsWith(github.ref, 'refs/tags/v')
run: make publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}