-
-
Notifications
You must be signed in to change notification settings - Fork 16
64 lines (64 loc) · 2.29 KB
/
build-release.yml
File metadata and controls
64 lines (64 loc) · 2.29 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
name: build-release
on:
workflow_dispatch:
jobs:
build-extension:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
RepositoryUrl: 'https://github.com/${{ github.repository }}'
RepositoryBranch: '${{ github.ref }}'
SourceRevisionId: '${{ github.sha }}'
Configuration: Release
SolutionPath: PowerMode.sln
VsixManifestPath: PowerMode\source.extension.vsixmanifest
VsixPath: PowerMode\bin\Release\PowerMode.vsix
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
id: MsBuildSetup
- name: Restore NuGet Packages
run: nuget restore $env:SolutionPath
- name: Build Extension
run: msbuild $env:SolutionPath /t:Rebuild
env:
DeployExtension: False
# - name: Test extension
# run: dotnet test --no-build --verbosity normal $env:SolutionPath
- name: Generate Release Note
run: |
git fetch --prune --unshallow
$commitLog = git log "$(git describe --tags --abbrev=0)..HEAD" --pretty=format:"- %s"
"What's new: `r`n`r`n$([string]::Join("`r`n",$commitLog))" | Out-File release_note.md -Encoding utf8
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release_note.md
draft: true
prerelease: false
- name: Upload Release Asset - VSIX
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.VsixPath }}
asset_name: PowerMode.vsix
asset_content_type: binary/octet-stream
# - name: Publish extension to Marketplace
# uses: cezarypiatek/VsixPublisherAction@0.1
# with:
# extension-file: ${{ env.VsixPath }}
# publish-manifest-file: ${{ env.VsixPublishManifestPath }}
# personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}