Skip to content

Commit

Permalink
chore(jetify): fix build path
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBedard committed Sep 25, 2024
1 parent 92508d1 commit 24710ef
Showing 1 changed file with 51 additions and 25 deletions.
76 changes: 51 additions & 25 deletions .github/workflows/jetify.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: jetify

on:
push:
workflow_dispatch:
inputs:
version:
Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
} else {
"publish-test"
}
if (-Not $IsMasterBranch) {
$DryRun = $true # force dry run when not on master branch
}
Expand Down Expand Up @@ -134,7 +135,7 @@ jobs:
run: |
Enter-VsDevShell ${{matrix.arch}}
$GitCommit = '${{ needs.preflight.outputs.detours-git-commit }}'
.\detours.ps1 -GitCommit $GitCommit
.\jetify\detours.ps1 -GitCommit $GitCommit
- name: Save Detours Cache (${{matrix.arch}})
if: steps.cache-detours.outputs.cache-hit != 'true'
Expand All @@ -145,6 +146,7 @@ jobs:

- name: Build Jetify (${{matrix.arch}})
shell: pwsh
working-directory: jetify
run: |
$Arch = "${{matrix.arch}}"
$BuildDir = "build-$Arch"
Expand All @@ -156,13 +158,14 @@ jobs:
@('Jetify.dll') | % {
Copy-Item "$BuildDir/Release/$_" "dependencies/Jetify/$Arch"
}
mkdir package
Compress-Archive "dependencies\Jetify\$Arch\*" ".\package\Jetify-$PackageVersion-$Arch.zip" -CompressionLevel Optimal
- name: Upload Jetify (${{matrix.arch}})
uses: actions/upload-artifact@v4
with:
name: Jetify-${{matrix.arch}}
path: package/*.zip
path: jetify/package/*.zip

package:
name: Package Jetify
Expand Down Expand Up @@ -225,15 +228,16 @@ jobs:
'-kvc', '${{ secrets.CODE_SIGNING_CERTIFICATE_NAME }}',
'-tr', '${{ vars.CODE_SIGNING_TIMESTAMP_SERVER }}',
'-v')
Get-ChildItem "$UnpackedDir\lib" -Include @("*.dll") -Recurse | ForEach-Object {
Get-ChildItem "$UnpackedDir" -Include @("*.dll") -Recurse | ForEach-Object {
AzureSignTool @Params $_.FullName
}
Remove-Item $PackedFile -ErrorAction SilentlyContinue | Out-Null
Compress-Archive -Path "$UnpackedDir\*" -Destination $PackedFile -CompressionLevel Optimal
- name: Code sign nuget package
if: ${{ fromJSON(needs.preflight.outputs.sign-nuget) == true }}
shell: pwsh
working-directory: jetify
run: |
$NugetPackage = (Get-Item ".\package\*.nupkg" | Select-Object -First 1) | Resolve-Path -Relative
$Params = @('sign', $NugetPackage,
Expand All @@ -245,7 +249,7 @@ jobs:
'-tr', '${{ vars.CODE_SIGNING_TIMESTAMP_SERVER }}',
'-v')
& NuGetKeyVaultSignTool @Params
- name: Upload nuget package
uses: actions/upload-artifact@v4
with:
Expand All @@ -257,7 +261,7 @@ jobs:
runs-on: ubuntu-22.04
needs: [preflight, build, package]
environment: ${{ needs.preflight.outputs.package-env }}
if: ${{ fromJSON(needs.preflight.outputs.skip-publish) == false }}
#if: ${{ fromJSON(needs.preflight.outputs.skip-publish) == false }}

steps:
- name: Download nuget package
Expand All @@ -266,21 +270,43 @@ jobs:
name: Jetify-nupkg
path: package

- name: Publish to nuget.org
shell: pwsh
run: |
$DryRun = [System.Boolean]::Parse('${{ needs.preflight.outputs.dry-run }}')
$NugetPackage = (Get-Item ./package/*.nupkg) | Resolve-Path -Relative
$PushArgs = @(
'nuget', 'push', "$NugetPackage",
'--api-key', '${{ secrets.NUGET_API_KEY }}',
'--source', 'https://api.nuget.org/v3/index.json',
'--skip-duplicate', '--no-symbols'
)
Write-Host "dotnet $($PushArgs -Join ' ')"
if ($DryRun) {
Write-Host "Dry Run: skipping nuget.org publishing!"
} else {
& 'dotnet' $PushArgs
}
# - name: Publish to nuget.org
# shell: pwsh
# run: |
# $DryRun = [System.Boolean]::Parse('${{ needs.preflight.outputs.dry-run }}')
# $NugetPackage = (Get-Item ./package/*.nupkg) | Resolve-Path -Relative

# $PushArgs = @(
# 'nuget', 'push', "$NugetPackage",
# '--api-key', '${{ secrets.NUGET_API_KEY }}',
# '--source', 'https://api.nuget.org/v3/index.json',
# '--skip-duplicate', '--no-symbols'
# )
# Write-Host "dotnet $($PushArgs -Join ' ')"
# if ($DryRun) {
# Write-Host "Dry Run: skipping nuget.org publishing!"
# } else {
# & 'dotnet' $PushArgs
# }

- name: Check out repository
uses: actions/checkout@v4
with:
repository: Devolutions/actions
path: actions
ref: v1

- run: ls

- run: ls package

- name: Setup Artifactory
uses: ./actions/nuget-artifactory-setup
with:
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
artifactory_username: ${{ secrets.ARTIFACTORY_USERNAME }}

# - name: Push
# uses: ./actions/dotnet-push
# with:
# working_directory: package

0 comments on commit 24710ef

Please sign in to comment.