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

Commit

Permalink
Reduce CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-mitka committed Dec 7, 2023
1 parent 47b1042 commit 6ceaf6a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ on:

jobs:
build:
if: false
strategy:
matrix:
runner-os: [windows-latest, ubuntu-latest, macos-latest]
# runner-os: [windows-latest, ubuntu-latest, macos-latest]
runner-os: [ubuntu-latest]

runs-on: ${{ matrix.runner-os }}

Expand All @@ -34,7 +36,7 @@ jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [ build ]
# needs: [ build ]
environment: PUBLISH_RELEASE

steps:
Expand Down
52 changes: 26 additions & 26 deletions publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ if ((Test-Path env:CLI_VERSION) -And $env:CLI_VERSION.StartsWith("refs/tags/v"))

Write-Output "version: $AssemblyVersion"

if ((Test-Path env:SKIP_WINDOWS) -And $env:SKIP_WINDOWS.ToUpper() -eq "TRUE") {
Write-Output "Skipping Windows build because SKIP_WINDOWS is set"
}
else {
dotnet publish src/SecretsMigrator.csproj -c Release -o dist/win-x64/ -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
# if ((Test-Path env:SKIP_WINDOWS) -And $env:SKIP_WINDOWS.ToUpper() -eq "TRUE") {
# Write-Output "Skipping Windows build because SKIP_WINDOWS is set"
# }
# else {
# dotnet publish src/SecretsMigrator.csproj -c Release -o dist/win-x64/ -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion

if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
# if ($LASTEXITCODE -ne 0) {
# exit $LASTEXITCODE
# }

if (Test-Path -Path ./dist/win-x64/secrets-migrator-windows-amd64.exe) {
Remove-Item ./dist/win-x64/secrets-migrator-windows-amd64.exe
}
# if (Test-Path -Path ./dist/win-x64/secrets-migrator-windows-amd64.exe) {
# Remove-Item ./dist/win-x64/secrets-migrator-windows-amd64.exe
# }

Rename-Item ./dist/win-x64/SecretsMigrator.exe secrets-migrator-windows-amd64.exe
}
# Rename-Item ./dist/win-x64/SecretsMigrator.exe secrets-migrator-windows-amd64.exe
# }

if ((Test-Path env:SKIP_LINUX) -And $env:SKIP_LINUX.ToUpper() -eq "TRUE") {
Write-Output "Skipping Linux build because SKIP_LINUX is set"
Expand All @@ -42,19 +42,19 @@ else {
Rename-Item ./dist/linux-x64/SecretsMigrator secrets-migrator-linux-amd64
}

if ((Test-Path env:SKIP_MACOS) -And $env:SKIP_MACOS.ToUpper() -eq "TRUE") {
Write-Output "Skipping MacOS build because SKIP_MACOS is set"
}
else {
dotnet publish src/SecretsMigrator.csproj -c Release -o dist/osx-x64/ -r osx-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
# if ((Test-Path env:SKIP_MACOS) -And $env:SKIP_MACOS.ToUpper() -eq "TRUE") {
# Write-Output "Skipping MacOS build because SKIP_MACOS is set"
# }
# else {
# dotnet publish src/SecretsMigrator.csproj -c Release -o dist/osx-x64/ -r osx-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion

if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
# if ($LASTEXITCODE -ne 0) {
# exit $LASTEXITCODE
# }

if (Test-Path -Path ./dist/osx-x64/secrets-migrator-darwin-amd64) {
Remove-Item ./dist/osx-x64/secrets-migrator-darwin-amd64
}
# if (Test-Path -Path ./dist/osx-x64/secrets-migrator-darwin-amd64) {
# Remove-Item ./dist/osx-x64/secrets-migrator-darwin-amd64
# }

Rename-Item ./dist/osx-x64/SecretsMigrator secrets-migrator-darwin-amd64
}
# Rename-Item ./dist/osx-x64/SecretsMigrator secrets-migrator-darwin-amd64
# }
2 changes: 1 addition & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private static string GenerateWorkflow(string sourceOrg, string sourceRepo, stri
steps:
- name: Install Crypto Package
run: |
Get-PackageProvider | where name -eq 'nuget' | Install-PackageProvider
Get-PackageProvider | where name -eq 'nuget' | Install-PackageProvider -Force
Install-Package -Name Sodium.Core -ProviderName NuGet -Scope CurrentUser -RequiredVersion 1.3.0 -Destination . -Force
shell: pwsh
- name: Migrate Secrets
Expand Down

0 comments on commit 6ceaf6a

Please sign in to comment.