-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.67 KB
/
publish.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
name: publish
on:
push:
tags:
- 'v*' # 匹配所有以v开头的tag,比如 v1.0.0
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Add nuget to PATH
uses: nuget/setup-nuget@v1
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
shell: bash
- name: Update version
run: |
(Get-Content -Path FUIAnalyzer.Vsix\source.extension.vsixmanifest) |
ForEach-Object {$_ -Replace '1.0.0', '${{ env.VERSION }}'} |
Set-Content -Path FUIAnalyzer.Vsix\source.extension.vsixmanifest
- name: Restore
run: nuget restore
- name: Build
run: |
msbuild FUIAnalyzer.Vsix\FUIAnalyzer.Vsix.csproj `
/p:configuration=Release `
/p:DeployExtension=false `
/p:ZipPackageCompressionLevel=normal `
/p:OutputPath="${{github.workspace}}\artifacts"
- name: List files
run: |
Write-Host "Current location:"
Get-Location
Write-Host "Listing workspace directory:"
Get-ChildItem -Path ${{github.workspace}} -Recurse -Filter *.vsix
shell: pwsh
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/*.vsix
name: FUIAnalyzer-${{ env.VERSION }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}