-
Notifications
You must be signed in to change notification settings - Fork 12
132 lines (108 loc) · 3.84 KB
/
build.yml
File metadata and controls
132 lines (108 loc) · 3.84 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build
on:
push:
tags: ['v*']
branches: ['**']
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.4.x'
- name: GitVersion
uses: gittools/actions/gitversion/execute@v4
id: gitversion
- name: Set version
shell: pwsh
run: |
$version = '${{ steps.gitversion.outputs.semVer }}'
Write-Host "Version: $version"
echo "VERSION=$version" >> $env:GITHUB_ENV
- name: Build x64
run: cargo build --release --target x86_64-pc-windows-msvc
- name: Build ARM64
run: cargo build --release --target aarch64-pc-windows-msvc
- name: Azure Login
if: startsWith(github.ref, 'refs/tags/')
uses: azure/login@v2
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
- name: Sign executables with Trusted Signing
if: startsWith(github.ref, 'refs/tags/')
uses: azure/trusted-signing-action@v1
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://wus2.codesigning.azure.net/
signing-account-name: hanselman
certificate-profile-name: WindowsEdgeLight
files-folder: ${{ github.workspace }}
files-folder-filter: exe
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Prepare artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Path artifacts -Force
Copy-Item "target/x86_64-pc-windows-msvc/release/winget-tui.exe" -Destination "artifacts/winget-tui-x64.exe"
Copy-Item "target/aarch64-pc-windows-msvc/release/winget-tui.exe" -Destination "artifacts/winget-tui-arm64.exe"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: winget-tui-${{ env.VERSION }}
path: artifacts/*.exe
release:
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*.exe
generate_release_notes: true
body: |
## winget-tui ${{ github.ref_name }}
A terminal UI for Windows Package Manager (winget).
### 📦 Downloads
| File | Platform |
|------|----------|
| `winget-tui-x64.exe` | Windows x64 |
| `winget-tui-arm64.exe` | Windows ARM64 |
### Usage
Download the executable for your platform and run it. No installation required.
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}