Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano committed Nov 12, 2021
2 parents 8dc20a5 + cebbc84 commit 0a4e497
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
16 changes: 14 additions & 2 deletions BuildScripts/InjectGitVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@ param (
)

$PSDefaultParameterValues = @{ '*:Encoding' = 'utf8' }
$productVersion = "1.4.";
$productVersion = "1.5.";
$revision = "0";

$fileNames = Get-ChildItem -Path (Split-Path -Parent $PSScriptRoot) -Recurse -Include *.template

$gitVersion = git describe --all --long --always --first-parent;
$gitVersion -match '.*/([\w\d]+)-(\d+)-[g](\w+)$';
$match = $gitVersion -match '.*/([\w\d-]+)-(\d+)-[g](\w+)$';
if ( -not $match ){
Write-Host ( "Can not determine git version: {0}" -f $gitVersion );
exit 1;
}

$gitTag = $Matches[1];
$gitSHA1 = $Matches[3];

$fileVersion = $productVersion + $Version + "." + $revision;
$InfoVersion = $productVersion + $Version + "." + $revision + "-" + $gitTag + "-" + $gitSHA1;

Write-Host "File Version: " + $fileVersion;
Write-Host "Info Version: " + $InfoVersion;

foreach ($fileName in $fileNames) {
# Define file variables
$file = Get-Item $fileName;
Expand All @@ -30,3 +41,4 @@ foreach ($fileName in $fileNames) {
}
}


10 changes: 5 additions & 5 deletions CodeBeautifier-VSPackage/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="c2024206-0b8d-4e03-9ad0-4cc3bfe60dea" Version="1.4.0.0" Language="en-US" Publisher="Mariusz Brzeski" />
<Identity Id="c2024206-0b8d-4e03-9ad0-4cc3bfe60dea" Version="1.5.0.0" Language="en-US" Publisher="Mariusz Brzeski" />
<DisplayName>CodeBeautifier</DisplayName>
<Description xml:space="preserve">Code beautifier front end Add-in for Visual Studio evironment. Allows to use of any external code format application. </Description>
<MoreInfo>http://www.manobit.com/code-beautifier-for-visual-studio/</MoreInfo>
Expand All @@ -13,9 +13,9 @@
<Tags>beautifier, clang, code, code formatting, format, formatting, indentation, uncrustify, Visual Studo</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,]">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[17.0,18.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Enterprise" Version="[17.0,18.0)" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
Expand All @@ -24,6 +24,6 @@
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,]" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
</Prerequisites>
</PackageManifest>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<Tags>beautifier, clang, code, code formatting, format, formatting, indentation, uncrustify, Visual Studo</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[17.0,18.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Enterprise" Version="[17.0,18.0)" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
Expand All @@ -24,6 +24,6 @@
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
</Prerequisites>
</PackageManifest>
33 changes: 33 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ pipeline
options {
skipDefaultCheckout true
}
environment {
GITHUB_TOKEN = credentials('marianob85-github-jenkins')
}
stages
{
stage('Build'){
agent{ label "windows/buildtools2019" }
steps {
checkout scm
script {
env.GITHUB_REPO = sh(script: 'basename $(git remote get-url origin) .git', returnStdout: true).trim()
}
powershell './BuildScripts/InjectGitVersion.ps1 -Version $env:BUILD_NUMBER'
bat '''
call "C:/BuildTools/VC/Auxiliary/Build/vcvars64.bat"
Expand All @@ -29,6 +35,7 @@ pipeline
}
}
stage('UnitTests'){
agent{ label "windows/buildtools2019" }
steps {
unstash "unitTest"
powershell '''
Expand All @@ -38,6 +45,7 @@ pipeline
}
}
stage('Compile check'){
agent any
steps {
unstash "warningsFiles"
script {
Expand All @@ -48,11 +56,36 @@ pipeline
}

stage('Archive'){
agent any
steps {
unstash "bin"
archiveArtifacts artifacts: 'Installers/*, CodeBeautifier-VSPackage/out/Release/*.vsix', onlyIfSuccessful: true
}
}

stage('Release') {
when {
buildingTag()
}
agent{ label "linux/u18.04/go:1.17.3" }
steps {
unstash 'bin'
sh '''
go install github.com/github-release/[email protected]
github-release release --user marianob85 --repo ${GITHUB_REPO} --tag ${TAG_NAME} --name ${TAG_NAME}
for filename in CodeBeautifier-VSPackage/out/Release/*.vsix; do
[ -e "$filename" ] || continue
basefilename=$(basename "$filename")
github-release upload --user marianob85 --repo ${GITHUB_REPO} --tag ${TAG_NAME} --name ${basefilename} --file ${filename}
done
for filename in Installers/*.zip; do
[ -e "$filename" ] || continue
basefilename=$(basename "$filename")
github-release upload --user marianob85 --repo ${GITHUB_REPO} --tag ${TAG_NAME} --name ${basefilename} --file ${filename}
done
'''
}
}
}
post {
changed {
Expand Down

0 comments on commit 0a4e497

Please sign in to comment.