Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Remove 7z; Also remove MacOS code signing from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Jul 3, 2022
1 parent f9e3c1b commit 26f55e9
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 115 deletions.
80 changes: 4 additions & 76 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,80 +27,8 @@ jobs:
with:
name: packages
path: .\build\Release\*.nupkg

# https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
package-macos:
name: Sign OSX
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }}
runs-on: macos-latest
needs: [ build-windows ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install NGBV
run: dotnet tool install --tool-path . nbgv
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: packages
- name: Extract Artifacts
run: |
unzip Clowd.Squirrel*.nupkg -d ./squirrel/
unzip csq*.nupkg -d ./csq/
- name: Install mitchellh/gon
run: brew install mitchellh/gon/gon
- name: Install Apple Certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.APPLE_BUILD_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# write certificate to file
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
# create temporary keychain
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Sign and Notarize
env:
AC_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
AC_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
run: gon ./gon.config.json
- name: Clean up KeyChain
if: ${{ always() }}
run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
- name: Fix Packages
run: |
export NUGET_VERSION=$(./nbgv get-version -f json | python3 -c "import sys, json; print(json.load(sys.stdin)['NuGetPackageVersion'])")
echo $NUGET_VERSION
unzip ./signed.zip -d ./bsigned/
cp ./bsigned/UpdateMac ./squirrel/tools/
cp ./bsigned/UpdateMac ./csq/tools/net6.0/any/
cp ./bsigned/7zz ./squirrel/tools/
cp ./bsigned/7zz ./csq/tools/net6.0/any/
rm -rf *.nupkg
chmod 755 ./vendor/7zz
./vendor/7zz a csq.${NUGET_VERSION}.nupkg -tzip -mx9 "${GITHUB_WORKSPACE}/csq/*"
./vendor/7zz a Clowd.Squirrel.${NUGET_VERSION}.nupkg -tzip -mx9 "${GITHUB_WORKSPACE}/squirrel/*"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: packages-final
path: "*.nupkg"
- name: Publish Dev NuGet Package
- name: Publish to GitHub Packages
shell: pwsh
run: |
export NUGET_VERSION=$(./nbgv get-version -f json | python3 -c "import sys, json; print(json.load(sys.stdin)['NuGetPackageVersion'])")
nuget push csq.${NUGET_VERSION}.nupkg -ApiKey ${{ secrets.GITHUB_TOKEN }} -Source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -SkipDuplicate
nuget push Clowd.Squirrel.${NUGET_VERSION}.nupkg -ApiKey ${{ secrets.GITHUB_TOKEN }} -Source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -SkipDuplicate
nuget push csq.*.nupkg -ApiKey ${{ secrets.GITHUB_TOKEN }} -Source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -SkipDuplicate
nuget push Clowd.Squirrel.*.nupkg -ApiKey ${{ secrets.GITHUB_TOKEN }} -Source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json -SkipDuplicate
1 change: 0 additions & 1 deletion Squirrel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionLevel", "SolutionLe
.github\workflows\build.yml = .github\workflows\build.yml
build.ps1 = build.ps1
Squirrel.entitlements = Squirrel.entitlements
gon.config.json = gon.config.json
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Setup", "src\Setup\Setup.vcxproj", "{6B406985-B2E1-4FED-A405-BD0694D68E93}"
Expand Down
7 changes: 7 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ dotnet publish -v minimal --no-build -c Release --self-contained "$PSScriptRoot\
dotnet publish -v minimal --no-build -c Release --self-contained "$PSScriptRoot\src\Update.OSX\Update.OSX.csproj" -o "$ToolsDir"

Write-Host "Copying Tools" -ForegroundColor Magenta
# First, copy all the tools into the 'csq' package
Copy-Item -Path "$PSScriptRoot\vendor\*" -Destination $ToolsDir -Recurse
Copy-Item -Path "Win32\*" -Destination $ToolsDir
Copy-Item -Path "$PSScriptRoot\Squirrel.entitlements" -Destination "$ToolsDir"
Remove-Item "$ToolsDir\*.pdb"
Remove-Item "$ToolsDir\7za.exe"

# Second, copy all the csq files into the 'squirrel' package
New-Item -Path "squirrel" -Name "tools" -ItemType "directory"
Copy-Item -Path "$ToolsDir\*" -Destination "squirrel\tools" -Recurse
Remove-Item "squirrel\tools\*.xml"
Expand Down
14 changes: 0 additions & 14 deletions gon.config.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/Squirrel.CommandLine/DeltaPackageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void printProcessed(int cur, int? removed = null)
printProcessed(newLibFiles.Length, baseLibFiles.Count);

ReleasePackageBuilder.addDeltaFilesToContentTypes(tempInfo.FullName);
HelperFile.CompressLzma7z(outputFile, tempInfo.FullName);
EasyZip.CreateZipFromDirectory(outputFile, tempInfo.FullName);

this.Log().Info(
$"Successfully created delta package for {basePackage.Version} -> {newPackage.Version}" +
Expand Down
17 changes: 2 additions & 15 deletions src/Squirrel.CommandLine/HelperFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ namespace Squirrel.CommandLine
{
internal class HelperFile
{
private static string SevenZipPath {
get {
if (SquirrelRuntimeInfo.IsWindows) return FindHelperFile("7za.exe");
if (SquirrelRuntimeInfo.IsOSX) return FindHelperFile("7zz");
throw new NotImplementedException("Unsupported OS");
}
}

private static List<string> _searchPaths = new List<string>();
protected static IFullLogger Log = SquirrelLocator.CurrentMutable.GetService<ILogManager>().GetLogger(typeof(HelperFile));

static HelperFile()
{
AddSearchPath(SquirrelRuntimeInfo.BaseDirectory, "wix");

#if DEBUG
AddSearchPath(SquirrelRuntimeInfo.BaseDirectory, "..", "..", "..", "build", "publish");
AddSearchPath(SquirrelRuntimeInfo.BaseDirectory, "..", "..", "..", "build", "Release", "squirrel", "tools");
Expand Down Expand Up @@ -93,13 +87,6 @@ protected static string FindHelperFile(string toFind, Func<string, bool> predica
return result;
}

public static void CompressLzma7z(string zipFilePath, string inFolder)
{
Log.Info($"Compressing '{inFolder}' to '{zipFilePath}' using 7z (LZMA)...");
var args = new string[] { "a", zipFilePath, "-tzip", "-m0=LZMA", "-aoa", "-y", "*" };
InvokeAndThrowIfNonZero(SevenZipPath, args, inFolder);
}

protected static string InvokeAndThrowIfNonZero(string exePath, IEnumerable<string> args, string workingDir)
{
var result = PlatformUtil.InvokeProcess(exePath, args, workingDir, CancellationToken.None);
Expand Down
4 changes: 1 addition & 3 deletions src/Squirrel.CommandLine/ReleasePackageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ internal string CreateReleasePackage(string outputFile, Func<string, string> rel
"The input package file {0} must have no dependencies.", InputPackageFile));
}

//var targetFramework = frameworks.Single();

this.Log().Info("Creating release package: {0} => {1}", InputPackageFile, outputFile);


using (Utility.GetTempDirectory(out var tempPath)) {
var tempDir = new DirectoryInfo(tempPath);

Expand All @@ -122,7 +120,7 @@ internal string CreateReleasePackage(string outputFile, Func<string, string> rel

contentsPostProcessHook?.Invoke(tempPath, package);

HelperFile.CompressLzma7z(outputFile, tempPath);
EasyZip.CreateZipFromDirectory(outputFile, tempPath);

ReleasePackageFile = outputFile;
return ReleasePackageFile;
Expand Down
5 changes: 0 additions & 5 deletions src/Squirrel.Tool/Squirrel.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@
<PackAsTool>true</PackAsTool>
<Description>A .NET Core Tool that uses the Squirrel framework to create installers and update packages for dotnet applications.</Description>
<PackageIcon>Clowd_200.png</PackageIcon>
<PackageVendor>tools\net6.0\any\</PackageVendor>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\vendor\wix\*" Pack="true" PackagePath="$(PackageVendor)" />
<None Include="..\..\vendor\*" Pack="true" PackagePath="$(PackageVendor)" />
<None Include="..\..\build\$(Configuration)\Win32\Setup.exe" Pack="true" PackagePath="$(PackageVendor)" />
<None Include="..\..\build\$(Configuration)\Win32\StubExecutable.exe" Pack="true" PackagePath="$(PackageVendor)" />
<None Include="..\..\docs\artwork\Clowd_200.png" Pack="true" PackagePath="\" />
</ItemGroup>

Expand Down
Binary file removed vendor/7zz
Binary file not shown.

0 comments on commit 26f55e9

Please sign in to comment.