Skip to content

Commit

Permalink
Merge pull request #34 from datalust/dev
Browse files Browse the repository at this point in the history
1.1.0 Release
  • Loading branch information
nblumhardt authored Sep 23, 2021
2 parents 0669528 + 052a851 commit 794a8cd
Show file tree
Hide file tree
Showing 28 changed files with 1,090 additions and 1,168 deletions.
74 changes: 37 additions & 37 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
$ErrorActionPreference = 'Stop'

$framework = 'net5.0'

function Clean-Output
{
if(Test-Path ./artifacts) { rm ./artifacts -Force -Recurse }
Expand All @@ -8,60 +12,56 @@ function Restore-Packages
& dotnet restore
}

function Update-AssemblyInfo($version)
{
$versionPattern = "[0-9]+(\.([0-9]+|\*)){3}"

foreach ($file in ls ./src/*/Properties/AssemblyInfo.cs)
{
(cat $file) | foreach {
% {$_ -replace $versionPattern, "$version.0" }
} | sc -Encoding "UTF8" $file
}
}

function Update-WixVersion($version)
function Execute-Tests
{
$defPattern = "define Version = ""0\.0\.0"""
$def = "define Version = ""$version"""
$product = ".\setup\Datalust.ClefTool.Setup\Product.wxs"

(cat $product) | foreach {
% {$_ -replace $defPattern, $def }
} | sc -Encoding "UTF8" $product
& dotnet test ./test/Datalust.ClefTool.Tests/Datalust.ClefTool.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 3 }
}

function Execute-MSBuild
function Create-ArtifactDir
{
& msbuild ./clef-tool.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64
mkdir ./artifacts
}

function Execute-Tests
function Publish-Archives($version)
{
pushd ./test/Datalust.ClefTool.Tests
$rids = @("linux-x64", "linux-musl-x64", "linux-arm64", "osx-x64", "win-x64")
foreach ($rid in $rids) {
$tfm = $framework

& dotnet publish ./src/Datalust.ClefTool/Datalust.ClefTool.csproj -c Release -f $tfm -r $rid /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { exit 4 }

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
# Make sure the archive contains a reasonable root filename
mv ./src/Datalust.ClefTool/bin/Release/$tfm/$rid/publish/ ./src/Datalust.ClefTool/bin/Release/$tfm/$rid/clef-$version-$rid/

popd
}
if ($rid.StartsWith("win-")) {
& ./build/7-zip/7za.exe a -tzip ./artifacts/clef-$version-$rid.zip ./src/Datalust.ClefTool/bin/Release/$tfm/$rid/clef-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }
} else {
& ./build/7-zip/7za.exe a -ttar clef-$version-$rid.tar ./src/Datalust.ClefTool/bin/Release/$tfm/$rid/clef-$version-$rid/
if($LASTEXITCODE -ne 0) { exit 5 }

function Publish-Artifacts($version)
{
mkdir ./artifacts
mv ./setup/Datalust.ClefTool.Setup/bin/Release/clef.msi ./artifacts/clef-$version-pre.msi
# Back to the original directory name
mv ./src/Datalust.ClefTool/bin/Release/$tfm/$rid/clef-$version-$rid/ ./src/Datalust.ClefTool/bin/Release/$tfm/$rid/publish/

& ./build/7-zip/7za.exe a -tgzip ./artifacts/clef-$version-$rid.tar.gz clef-$version-$rid.tar
if($LASTEXITCODE -ne 0) { exit 6 }

rm clef-$version-$rid.tar
}
}
}

Push-Location $PSScriptRoot

$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "0.0.0" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
Write-Output "Building version $version"

Clean-Output
Create-ArtifactDir
Restore-Packages
Update-AssemblyInfo($version)
Update-WixVersion($version)
Execute-MSBuild
Publish-Archives($version)
Execute-Tests
Publish-Artifacts($version)

Pop-Location
9 changes: 5 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
version: 1.0.{build}
version: 1.1.{build}
skip_tags: true
image: Visual Studio 2019
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/*.msi
- path: artifacts/clef-*.zip
- path: artifacts/clef-*.tar.gz
- path: artifacts/clef.*.nupkg
deploy:
- provider: GitHub
auth_token:
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
artifact: /clef-.*\.msi/
tag: v$(appveyor_build_version)
on:
branch: master
branch: main
387 changes: 0 additions & 387 deletions asset/ClefToolLicense.rtf

This file was deleted.

Binary file added build/7-zip/7za.dll
Binary file not shown.
Binary file added build/7-zip/7za.exe
Binary file not shown.
Binary file added build/7-zip/7zxa.dll
Binary file not shown.
85 changes: 85 additions & 0 deletions build/7-zip/Far/7-ZipEng.hlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
.Language=English,English
.PluginContents=7-Zip Plugin

@Contents
$^#7-Zip Plugin 16.04#
$^#Copyright (c) 1999-2016 Igor Pavlov#
This FAR module performs transparent #archive# processing.
Files in the archive are handled in the same manner as if they
were in a folder.

~Extracting from the archive~@Extract@

~Add files to the archive~@Update@

~7-Zip Plugin configuration~@Config@


Web site: #www.7-zip.org#

@Extract
$ #Extracting from the archive#

In this dialog you may enter extracting mode.

Path mode

#Full pathnames# Extract files with full pathnames.

#Current pathnames# Extract files with all relative paths.

#No pathnames# Extract files without folder paths.


Overwrite mode

#Ask before overwrite# Ask before overwriting existing files.

#Overwrite without prompt# Overwrite existing files without prompt.

#Skip existing files# Skip extracting of existing files.


Files

#Selected files# Extract only selected files.

#All files# Extract all files from archive.

@Update
$ #Add files to the archive#

This dialog allows you to specify options for process of updating archive.


Compression method

#Store# Files will be copied to archive without compression.

#Normal# Files will be compressed.

#Maximum# Files will be compressed with method that gives
maximum compression ratio.


Update mode

#Add and replace files# Add all specified files to the archive.

#Update and add files# Update older files in the archive and add
files that are new to the archive.

#Freshen existing files# Update specified files in the archive that
are older than the selected disk files.

#Synchronize files# Replace specified files only if
added files are newer. Always add those
files, which are not present in the
archive. Delete from archive those files,
which are not present on the disk.

@Config
$ #7-Zip Plugin configuration#
In this dialog you may change following parameters:

#Plugin is used by default# Plugin is used by default.
Loading

0 comments on commit 794a8cd

Please sign in to comment.