Skip to content

Commit 30a0805

Browse files
author
Grzegorz Gurgul
committed
Initial version.
0 parents  commit 30a0805

File tree

82 files changed

+4181
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+4181
-0
lines changed

.gitattributes

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: 'Get Next SemVer Tag'
2+
description: 'Get next Git tag in semver format'
3+
outputs:
4+
next-tag:
5+
description: 'next Git tag in semver format'
6+
value: ${{ steps.get-next-semver-tag.outputs.next-tag }}
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- id: get-next-semver-tag
11+
run: ${{ github.action_path }}/next-git-tag.ps1 -Verbose
12+
shell: pwsh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<#
2+
.SYNOPSIS
3+
This script calculates a next Git tag in SemVer format.
4+
#>
5+
[CmdletBinding()]
6+
Param()
7+
8+
[string[]]$AllTags = (git tag --sort=committerdate)
9+
Write-Verbose "all tags: $AllTags"
10+
$LatestTag = $AllTags[$AllTags.Length - 1]
11+
Write-Host "Found latest Git tag: $LatestTag"
12+
13+
# split the tag by dots and increment patch version
14+
$v = $LatestTag -split "\."
15+
[string] $MajorStr = $v[0]
16+
[int] $Major = 0
17+
if ($MajorStr.StartsWith("v")) {
18+
$Major = $MajorStr.Substring(1)
19+
}
20+
else {
21+
$Major = $MajorStr
22+
}
23+
[int] $Minor = $v[1]
24+
[int] $Patch = $v[2]
25+
26+
Write-Verbose "MAJOR part: $Major"
27+
Write-Verbose "MINOR part: $Minor"
28+
Write-Verbose "PATCH part: $Patch"
29+
30+
# hardcoded increment for patch
31+
$Patch += 1;
32+
33+
$NextSemverTag = "$Major.$Minor.$Patch"
34+
Write-Host "Next SemVer tag: $NextSemverTag"
35+
36+
# Return next tag to workflow
37+
Write-Output "::set-output name=next-tag::$NextSemverTag"

.github/workflows/build.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
env:
9+
SOLUTION_FILE_PATH: .
10+
DEFAULT_BRANCH: main
11+
12+
jobs:
13+
build:
14+
runs-on: windows-2022
15+
defaults:
16+
run:
17+
working-directory: ${{ github.workspace }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Add MSBuild to PATH
25+
uses: microsoft/setup-msbuild@v1
26+
with:
27+
vs-version: '[17.0, ]'
28+
29+
- name: Setup VSTest
30+
uses: darenm/Setup-VSTest@v1
31+
32+
- name: Restore NuGet packages
33+
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
34+
35+
- name: Build
36+
run: |
37+
msbuild ${{env.SOLUTION_FILE_PATH}} /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
38+
shell: powershell
39+
40+
- name: Tests
41+
run: vstest.console.exe **\*.Tests.dll /TestCaseFilter:"FullyQualifiedName!=Xunit.Instances.VisualStudio&integration!=true" #exclude integration tests and the psuedo-tests that launch a VS instance

.github/workflows/release.yml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
env:
10+
SOLUTION_FILE_PATH: .
11+
DEFAULT_BRANCH: main
12+
13+
jobs:
14+
build-test-and-release-vs22:
15+
runs-on: windows-2022
16+
defaults:
17+
run:
18+
working-directory: ${{ github.workspace }}
19+
env:
20+
VsixManifestPath: .\GitTreeFilter\source.extension.vsixmanifest
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
- uses: actions/cache@v2
28+
with:
29+
path: ~/.nuget/packages
30+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}
31+
restore-keys: |
32+
${{ runner.os }}-nuget-
33+
34+
- name: Add MSBuild to PATH
35+
uses: microsoft/setup-msbuild@v1
36+
with:
37+
vs-version: '[17.0, )'
38+
39+
- name: Setup VSTest
40+
uses: darenm/Setup-VSTest@v1
41+
42+
- name: Restore NuGet packages
43+
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
44+
45+
- name: Calculate next semantic version Git tag (vsix version)
46+
id: vsix_version
47+
uses: ./.github/actions/next-git-tag
48+
49+
- name: Set VSIX version for 2022
50+
uses: cezarypiatek/[email protected]
51+
with:
52+
version: ${{ steps.vsix_version.outputs.next-tag }}
53+
vsix-manifest-file: .\GitTreeFilter\source.extension.vsixmanifest
54+
55+
- name: Build
56+
run: |
57+
msbuild ${{env.SOLUTION_FILE_PATH}} /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
58+
shell: powershell
59+
60+
- name: Tests
61+
run: vstest.console.exe **\*.Tests.dll
62+
63+
- name: Set up Git actions user
64+
uses: fregante/setup-git-user@v1
65+
66+
- name: Create and push Git tag release
67+
run: |
68+
git tag ${{ steps.vsix_version.outputs.next-tag }}
69+
git push origin main
70+
git push origin main --tags
71+
72+
- name: Create GitHub Release
73+
id: create_release
74+
uses: actions/create-release@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
tag_name: ${{ steps.vsix_version.outputs.next-tag }}
79+
release_name: Release ${{ steps.vsix_version.outputs.next-tag }}
80+
draft: false
81+
prerelease: false
82+
83+
- name: Upload GitHub Release 2022 Asset
84+
uses: actions/upload-release-asset@v1
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
upload_url: ${{ steps.create_release.outputs.upload_url }}
89+
asset_path: .\GitTreeFilter\bin\Release\GitTreeFilter.vsix
90+
asset_name: GitTreeFilter-${{ steps.vsix_version.outputs.next-tag }}-2022.vsix
91+
asset_content_type: application/zip
92+
93+
- name: Publish 2022 extension to Marketplace
94+
uses: cezarypiatek/[email protected]
95+
with:
96+
extension-file: '.\GitTreeFilter\bin\Release\GitTreeFilter.vsix'
97+
publish-manifest-file: '.\GitTreeFilter\vs-publish.json'
98+
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)