Skip to content

Commit c8d5ec5

Browse files
committed
Added release workflow.
1 parent 714a281 commit c8d5ec5

File tree

3 files changed

+95
-1
lines changed

3 files changed

+95
-1
lines changed

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
on:
2+
workflow_dispatch:
3+
4+
name: release
5+
jobs:
6+
build:
7+
name: Build
8+
runs-on: windows-2022
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
platform: [ x86, x64, arm64 ]
14+
configuration: [ Debug, Release ]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Build configure
21+
shell: cmd
22+
run: |
23+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
24+
msbuild Configure.sln /m /t:Rebuild /p:Configuration=${{ matrix.Configuration }},Platform=${{ matrix.platform }}
25+
26+
- name: Upload executable
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: Configure.${{ matrix.Configuration }}.${{ matrix.platform }}
30+
path: Artifacts/${{ matrix.Configuration }}/${{ matrix.platform}}/bin
31+
32+
release:
33+
name: Release
34+
runs-on: windows-2022
35+
needs: build
36+
37+
permissions:
38+
contents: write
39+
id-token: write
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- uses: actions/download-artifact@v4
46+
name: Download executables
47+
with:
48+
path: ${{ github.workspace }}/Artifacts
49+
merge-multiple: true
50+
51+
- name: Install dotnet sign
52+
shell: cmd
53+
run: dotnet tool install --global sign --prerelease
54+
55+
- name: Azure CLI login with federated credential
56+
uses: azure/login@v2
57+
with:
58+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
59+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
60+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
61+
62+
- name: Sign executables
63+
run: sign code trusted-signing *.exe `
64+
--trusted-signing-account ImageMagick `
65+
--trusted-signing-certificate-profile ImageMagick `
66+
--trusted-signing-endpoint https://eus.codesigning.azure.net `
67+
--verbosity information
68+
working-directory: ${{ github.workspace }}/Artifacts
69+
70+
- name: Set release number
71+
shell: bash
72+
run: echo "release=$(date +'%Y.%m.%d.%H%M')" >> $GITHUB_ENV
73+
74+
- name: Create and push tag
75+
shell: bash
76+
run: |
77+
git config user.name "github-actions[bot]"
78+
git config user.email "github-actions[bot]@users.noreply.github.com"
79+
git tag $release
80+
git push origin $release
81+
82+
- name: Publish release
83+
uses: softprops/action-gh-release@v2
84+
with:
85+
name: ${{ env.release }}
86+
tag_name: ${{ env.release }}
87+
files: |
88+
${{ github.workspace }}/Artifacts/Configure.Debug.x64.exe
89+
${{ github.workspace }}/Artifacts/Configure.Debug.arm64.exe
90+
${{ github.workspace }}/Artifacts/Configure.Debug.x86.exe
91+
${{ github.workspace }}/Artifacts/Configure.Release.x64.exe
92+
${{ github.workspace }}/Artifacts/Configure.Release.arm64.exe
93+
${{ github.workspace }}/Artifacts/Configure.Release.x86.exe

Configure.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3A5E34B4-03A6-4B48-8FDE-264C35052500}"
1111
ProjectSection(SolutionItems) = preProject
1212
.github\workflows\main.yml = .github\workflows\main.yml
13+
.github\workflows\release.yml = .github\workflows\release.yml
1314
EndProjectSection
1415
EndProject
1516
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{68488E9E-3323-4001-BBCA-4C2CDB6BED8C}"

src/Configure.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
6161
<LinkIncremental Condition="'$(Configuration)'=='Debug'">true</LinkIncremental>
6262
<LinkIncremental Condition="'$(Configuration)'=='Release'">false</LinkIncremental>
63-
<TargetName>Configure.$(PlatformType)</TargetName>
63+
<TargetName>Configure.$(Configuration).$(PlatformType)</TargetName>
6464
<OutputFolder>..\Artifacts\$(Configuration)\$(PlatformType)</OutputFolder>
6565
<OutDir>$(OutputFolder)\bin\</OutDir>
6666
<IntDir>$(OutputFolder)\obj\</IntDir>

0 commit comments

Comments
 (0)