-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2.41 KB
/
Release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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:
run-name: Release run ${{ var.TOOLKIT_VERSION }}.${{ github.RUN_NUMBER }} by @${{ github.actor }}
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"
cd .\artifacts\toolkit
7z a ..\Toolkit${{ env.RELEASEVERSION }}.zip *
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.RELEASEVERSION }}
files: |
License
artifacts/*.zip