Skip to content

MakeRelease

MakeRelease #2

Workflow file for this run

# Run this action to create a signed release of the toolkit
# TOOLKIT_VERSION is a repo variable of the major and minor release for the repo
# the release will have a patch version of the number of runs that this action has completed.
name: MakeRelease
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- id: create_version
name: Create version number
shell: pwsh
run: |
chcp 65001
$APPVERSION="$($env:TOOLKIT_VERSION).$($env:GITHUB_RUN_NUMBER)"
$RunVersion ="RELEASEVERSION=$APPVERSION"
Write-Host "$RunVersion=$RunVersion"
$RunVersion | Out-File -FilePath $env:GITHUB_ENV -Append
$RunVersion | Out-File -FilePath $env:GITHUB_OUTPUT -Append
env:
TOOLKIT_VERSION: ${{ vars.TOOLKIT_VERSION }}
- name: Trusted Signing
uses: Azure/[email protected]
with:
azure-tenant-id: ${{ secrets.TrustedSigningTenantID }}
azure-client-id: ${{ secrets.TrustedSigningSigningClientId }}
azure-client-secret: ${{ secrets.TrustedSigningSigningSecret}}
endpoint: ${{ secrets.TrustedSigningEndPoint }}
trusted-signing-account-name: ${{ secrets.TrustedSigningAccountName}}
certificate-profile-name: ${{ secrets.TrustedSigningCertificateProfile}}
files-folder: ${{ github.workspace }}
files-folder-filter: 'ps1,psm1,psd1,dll'
files-folder-recurse: true
files-folder-depth: 5
- name: Prepare release
shell: pwsh
run: |
$targetFolder = "artifacts\toolkit"
write-host "Preparing folder $targetFolder"
Remove-Item $targetFolder -Force -Recurse -ErrorAction SilentlyContinue
mkdir $targetFolder -Force
Copy-Item "Modules\*" "$targetFolder" -recurse
Copy-Item "Sample_Roundtrip.ps1" "$targetFolder"
Copy-Item "License" "$targetFolder"
Copy-Item "README.md" "$targetFolder"
7z a artifacts\Toolkit${{ env.RELEASEVERSION }}.zip $targetFolder
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.RELEASEVERSION }}
files: |
License
artifacts/*.zip