forked from madskristensen/AddAnyFile
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.61 KB
/
build.yaml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Build"
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
branches: [master]
jobs:
build:
outputs:
version: ${{ steps.vsix_version.outputs.version-number }}
name: Build
runs-on: windows-2022
env:
Configuration: Release
DeployExtension: False
VsixManifestPath: src\source.extension.vsixmanifest
VsixManifestSourcePath: src\source.extension.cs
steps:
- uses: actions/checkout@v2
- name: Setup .NET build dependencies
uses: timheuer/bootstrap-dotnet@v1
with:
nuget: 'false'
sdk: 'false'
msbuild: 'true'
- name: Increment VSIX version
id: vsix_version
uses: timheuer/vsix-version-stamp@v1
with:
manifest-file: ${{ env.VsixManifestPath }}
vsix-token-source-file: ${{ env.VsixManifestSourcePath }}
- name: Build
run: msbuild /v:m -restore /p:OutDir=../_built
#- name: Setup test
# uses: darenm/Setup-VSTest@v1
#- name: Test
# run: vstest.console.exe _built\*test.dll
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}.vsix
path: _built/**/*.vsix
publish:
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Download Package artifact
uses: actions/download-artifact@v2
with:
name: ${{ github.event.repository.name }}.vsix
- name: Upload to Open VSIX
uses: timheuer/openvsixpublish@v1
with:
vsix-file: ${{ github.event.repository.name }}.vsix
- name: Tag and Release
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[release]') }}
id: tag_release
uses: softprops/action-gh-release@v0.1.13
with:
body: Release ${{ needs.build.outputs.version }}
tag_name: ${{ needs.build.outputs.version }}
files: |
**/*.vsix
- name: Publish extension to Marketplace
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[release]') }}
uses: cezarypiatek/VsixPublisherAction@0.1
with:
extension-file: '${{ github.event.repository.name }}.vsix'
publish-manifest-file: 'vs-publish.json'
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}