Skip to content

Commit 6994788

Browse files
authored
Actions (#8)
* add package action * add github token * get token from secrets * fix unexpected token error * use call operator * execute individual commands instead of script * remove shell directive * replace jq by powershell regex
1 parent 644b86d commit 6994788

File tree

2 files changed

+5
-34
lines changed

2 files changed

+5
-34
lines changed

.github/workflows/reusable-package.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,8 @@ jobs:
77
steps:
88
- uses: actions/checkout@v3
99
- name: Build package
10-
run: |
11-
(gh release view -R ryanoasis/nerd-fonts --json assets) -match '(?<url>https://[^"]+?JetBrainsMono\.zip)"'
12-
$asset = $Matches.url
13-
14-
Invoke-WebRequest -Uri $asset -OutFile $PSScriptRoot\JetBrainsMono.zip
15-
Remove-Item `
16-
-Path $PSScriptRoot\JetBrainsMonoNF\Fonts `
17-
-Recurse `
18-
-Force `
19-
-ErrorAction SilentlyContinue
20-
New-Item `
21-
-Path $PSScriptRoot\JetBrainsMonoNF\Fonts `
22-
-ItemType Directory
23-
Expand-Archive `
24-
-Path $PSScriptRoot\JetBrainsMono.zip `
25-
-DestinationPath $PSScriptRoot\JetBrainsMonoNF\Fonts `
26-
-Force
27-
Remove-Item `
28-
-Path $PSScriptRoot\JetBrainsMonoNF\Fonts\* `
29-
-Exclude *Windows*
30-
31-
$asset -match '/v(?<version>[\d.]+)/'
32-
$version = $Matches.version
33-
34-
(Get-Content -Path $PSScriptRoot\JetBrainsMonoNF\Product.xml) `
35-
-creplace '(\bVersion=)"[\d.]+"', ('$1"' + $version + '"') `
36-
> $PSScriptRoot\JetBrainsMonoNF\Product.wxs
37-
38-
msbuild /p:Configuration=Release `
39-
$PSScriptRoot\JetBrainsMonoNF\JetBrainsMonoNF.wixproj
10+
shell: pwsh
11+
run: ./Build-Installer.ps1
4012
env:
4113
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4214
- uses: actions/upload-artifact@v3

Build-Installer.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
$ErrorActionPreference = 'Stop'
22

3-
$asset = gh release view `
4-
-R ryanoasis/nerd-fonts `
5-
--json assets `
6-
-q '.assets[].url|match(".*JetBrainsMono.*"; "g")|.string'
3+
(gh release view -R ryanoasis/nerd-fonts --json assets) `
4+
-match '(?<url>https://[^"]+?JetBrainsMono\.zip)"'
5+
$asset = $Matches.url
76

87
Invoke-WebRequest -Uri $asset -OutFile $PSScriptRoot\JetBrainsMono.zip
98
Remove-Item `

0 commit comments

Comments
 (0)