Skip to content

Commit f7914a4

Browse files
Create release.yml
1 parent c9e1eed commit f7914a4

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Run this action to create a signed release of the toolkit
2+
# TOOLKIT_VERSION is a repo variable of the major and minor release for the repo
3+
# the release will have a patch version of the number of runs that this action has completed.
4+
5+
name: MakeRelease
6+
7+
on:
8+
workflow_dispatch:
9+
10+
run-name: Release run ${{ github.RUN_NUMBER }} by @${{ github.actor }}
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- id: create_version
20+
name: Create version number
21+
shell: pwsh
22+
run: |
23+
chcp 65001
24+
$APPVERSION="$($env:TOOLKIT_VERSION).$($env:GITHUB_RUN_NUMBER)"
25+
$RunVersion ="RELEASEVERSION=$APPVERSION"
26+
Write-Host "$RunVersion=$RunVersion"
27+
$RunVersion | Out-File -FilePath $env:GITHUB_ENV -Append
28+
$RunVersion | Out-File -FilePath $env:GITHUB_OUTPUT -Append
29+
30+
env:
31+
TOOLKIT_VERSION: ${{ vars.TOOLKIT_VERSION }}
32+
33+
- name: Trusted Signing
34+
uses: Azure/[email protected]
35+
with:
36+
azure-tenant-id: ${{ secrets.TrustedSigningTenantID }}
37+
azure-client-id: ${{ secrets.TrustedSigningSigningClientId }}
38+
azure-client-secret: ${{ secrets.TrustedSigningSigningSecret}}
39+
endpoint: ${{ secrets.TrustedSigningEndPoint }}
40+
trusted-signing-account-name: ${{ secrets.TrustedSigningAccountName}}
41+
certificate-profile-name: ${{ secrets.TrustedSigningCertificateProfile}}
42+
files-folder: ${{ github.workspace }}
43+
files-folder-filter: 'ps1,psm1,psd1,dll'
44+
files-folder-recurse: true
45+
files-folder-depth: 5
46+
47+
- name: Prepare release
48+
shell: pwsh
49+
run: |
50+
$targetFolder = "artifacts\toolkit"
51+
write-host "Preparing folder $targetFolder"
52+
Remove-Item $targetFolder -Force -Recurse -ErrorAction SilentlyContinue
53+
mkdir $targetFolder -Force
54+
Copy-Item "*" "$targetFolder" -recurse -Exclude @("*.yml",".github",".vscode","artifacts" )
55+
cd .\artifacts\toolkit
56+
7z a ..\Toolkit${{ env.RELEASEVERSION }}.zip *
57+
58+
- name: Release
59+
uses: softprops/action-gh-release@v2
60+
with:
61+
name: Language Cloud PowerShell Toolkit v${{ env.RELEASEVERSION }}
62+
tag_name: v${{ env.RELEASEVERSION }}
63+
files: |
64+
artifacts/*.zip
65+

0 commit comments

Comments
 (0)