forked from jakobehn/GitFlow.VS
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (102 loc) · 4.57 KB
/
Copy pathRelease.yml
File metadata and controls
121 lines (102 loc) · 4.57 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# This is a basic workflow to help you get started with Actions
name: Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: windows-latest
env:
Solution_Path: GitFlowWithPR.VS.sln
Test_Project_Path: GitFlowWithPR.VS.Tests
Extension_Project_Path: GitFlowWithPR.VS.Extension
BuildConfiguration: 'VS2019'
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: fetch all history and tags from all branches for gitversion
run: git fetch --prune --unshallow
- name: install gitversion tool
uses: gittools/actions/gitversion/setup@v0.9
with:
versionSpec: '5.1.x'
- name: execute gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9
- 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 }}"
echo "AssemblySemVer : ${{ steps.gitversion.outputs.assemblySemVer }}"
- name: Update manifest version
run: |
[xml]$manifest = get-content ".\$env:Extension_Project_Path\source.extension.2019.vsixmanifest"
$manifest.PackageManifest.Metadata.Identity.Version = "${{ steps.gitversion.outputs.assemblySemVer }}"
$manifest.save(".\$env:Extension_Project_Path\source.extension.2019.vsixmanifest")
- name: add version in CHANGELOG.md
uses: cschleiden/replace-tokens@v1.0
with:
files: '${{github.workspace}}/CHANGELOG.md'
env:
VERSION: "${{ steps.gitversion.outputs.assemblySemVer }}"
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: Restore packages
run: nuget restore $env:Solution_Path
- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1
- name: Build with MSBuild
run: msbuild $env:Solution_Path /property:Configuration=$env:BuildConfiguration
- name: upload vsix as artifact
uses: actions/upload-artifact@v2
with:
name: GitFlow-With-PR-${{steps.gitversion.outputs.assemblySemVer}}
path: ${{ env.Extension_Project_Path }}\bin\${{ env.BuildConfiguration }}\GitFlowWithPRVS.2019.vsix
- name: upload README as artifact
uses: actions/upload-artifact@v2
with:
name: GitFlow-With-PR-${{steps.gitversion.outputs.assemblySemVer}}
path: README.md
- name: upload manifest as artifact
uses: actions/upload-artifact@v2
with:
name: GitFlow-With-PR-${{steps.gitversion.outputs.assemblySemVer}}
path: extension.manifest.json
- name: upload images as artifact
uses: actions/upload-artifact@v2
with:
name: GitFlow-With-PR-${{steps.gitversion.outputs.assemblySemVer}}
path: Images\*.*
- name: create a release
id: create_release
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.assemblySemVer }}
release_name: v${{ steps.gitversion.outputs.assemblySemVer }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.Extension_Project_Path }}\bin\${{ env.BuildConfiguration }}\GitFlowWithPRVS.2019.vsix
asset_name: GitFlow With PR ${{steps.gitversion.outputs.assemblySemVer}}.vsix
asset_content_type: application/zip
- name: Publish release to marketplace
id: publish-market-place
uses: mrluje/vs-marketplace-publisher@v2
with:
# (Required) Personal access token to perform action on the VS Marketplace
pat: ${{ secrets.VS_PAT }}
# (Required) Path to the manifest used for the publish
manifestPath: extension.manifest.json
useLatestReleaseAsset: true