-
Notifications
You must be signed in to change notification settings - Fork 91
148 lines (125 loc) · 4.51 KB
/
ci.yml
File metadata and controls
148 lines (125 loc) · 4.51 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
release:
types:
- created
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm install
- name: Run linters
run: npm run lint
- name: Run Build
run: npm run build
- name: Run Build Web
run: npm run build:web
- name: Run test
run: npm test
- name: Release
run: npm run release
env:
CERT_KEY: ${{ secrets.CERT_KEY }}
CERT_IV: ${{ secrets.CERT_IV }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASS }}
AZURE_KEY_VAULT_CERTIFICATE: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE }}
AZURE_KEY_VAULT_CLIENT_ID: ${{ secrets.AZURE_KEY_VAULT_CLIENT_ID }}
AZURE_KEY_VAULT_SECRET: ${{ secrets.AZURE_KEY_VAULT_SECRET }}
AZURE_KEY_VAULT_TENANT_ID: ${{ secrets.AZURE_KEY_VAULT_TENANT_ID }}
AZURE_KEY_VAULT_URL: ${{ secrets.AZURE_KEY_VAULT_URL }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List dist folder on Linux and Mac
if: runner.os == 'macOS' || runner.os == 'Linux'
run: ls -la dist
- name: Upload Mac installer artifact
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: UHK.Agent-mac-installer
path: dist/UHK.Agent-*-mac.dmg
compression-level: 0
retention-days: 30
- name: Upload Linux x64 AppImage artifact
if: runner.os == 'Linux' && runner.arch == 'X64'
uses: actions/upload-artifact@v4
with:
name: UHK.Agent-linux-x86_64.AppImage
path: dist/UHK.Agent-*-linux-x86_64.AppImage
compression-level: 0
retention-days: 30
- name: Upload Linux arm64 AppImage artifact
if: runner.os == 'Linux' && runner.arch == 'ARM64'
uses: actions/upload-artifact@v4
with:
name: UHK.Agent-linux-arm64.AppImage
path: dist/UHK.Agent-*-linux-arm64.AppImage
compression-level: 0
retention-days: 30
- name: List dist folder on Windows
if: runner.os == 'Windows'
run: dir dist
- name: Upload Windows installer artifacts
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: UHK.Agent-windows-installers
path: dist/UHK.Agent-*-win*.exe
compression-level: 0
retention-days: 30
- name: Run build-archiver
uses: UltimateHackingKeyboard/build-archiver@v0.0.4
if: github.ref == 'refs/heads/master' && github.event.repository.fork == false
with:
FILE_PATTERN: "dist/UHK.Agent-*-linux-x86_64.AppImage\ndist/UHK.Agent-*-linux-arm64.AppImage\ndist/UHK.Agent-*-mac.dmg\ndist/UHK.Agent-*-win*.exe"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
S3_ACCESS_KEY: ${{ secrets.UHK_BUILD_ARCHIVER_AWS_ACCESS_SECRET }}
S3_ACCESS_KEY_ID: ${{ secrets.UHK_BUILD_ARCHIVER_AWS_ACCESS_KEY }}
S3_BUCKET: "uhk-build-archives"
S3_KEY_PREFIX: "agent/"
S3_REGION: "eu-central-1"
updateReleaseNotes:
name: Update release notes
runs-on: ubuntu-latest
needs: test
if: github.ref_type == 'tag'
steps:
- uses: actions/checkout@v6
- name: Strip `v` from git tag and
run: |
TAG_VERSION=${{ github.ref_name }}
TAG_VERSION=${TAG_VERSION#v}
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Extract changelog
id: changelog
env:
VERSION: ${{ env.TAG_VERSION }}
run: |
DELIMITER=$(openssl rand -hex 16)
echo "content<<$DELIMITER" >> $GITHUB_OUTPUT
sed -n "/^## \\[${VERSION}\\]/,/^## \\[/p" CHANGELOG.md | sed '$d' | tail -n +3 >> $GITHUB_OUTPUT
echo "$DELIMITER" >> $GITHUB_OUTPUT
- name: Update GH release description
run: printf '%s' "$RELEASE_NOTES" | gh release edit ${{ github.ref_name }} --notes-file -
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NOTES: ${{ steps.changelog.outputs.content }}