-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (84 loc) · 3.53 KB
/
build-installer.yml
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
name: Build Windows installer on Release of audiobookshelf
on:
repository_dispatch:
types: [build-windows]
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
abs_ref:
description: 'Audiobookshelf ref to use'
required: false
jobs:
build-windows:
runs-on: windows-latest
steps:
# 0. Setup steps
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install pkg globally (using yao-pkg fork for targetting node20)
run: npm install -g @yao-pkg/pkg
- name: Setup .NET
uses: actions/setup-dotnet@v1
# 1. Build the audiobookshelf executable
- name: Get Latest Audiobookshelf Release Tag
id: get_latest_release
uses: actions/github-script@v7
with:
script: |
const { data } = await github.rest.repos.getLatestRelease({
owner: 'advplyr',
repo: 'audiobookshelf',
})
console.log('Audiobookshelf latest release tag: ' + data.tag_name)
return data.tag_name
result-encoding: string
- uses: actions/checkout@v3
with:
repository: advplyr/audiobookshelf
ref: ${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.abs_ref }}
path: ./audiobookshelf
- name: Install dependencies
run: npm ci
working-directory: ./audiobookshelf
- name: Build windows executable
run: npm run build-win
working-directory: ./audiobookshelf
# 2. Build the tray app
- uses: actions/checkout@v3
with:
path: ./audiobookshelf-windows
- name: Build solution
run: dotnet build -c Release
working-directory: ./audiobookshelf-windows
# 3. Build the installer
- name: Compile inno setup
run: iscc /DMyAppVersion=${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.tag }} Setup/installer.iss
working-directory: ./audiobookshelf-windows
# 4. Create a release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.tag }}
release_name: ${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.tag }}
body: |
- Server release [${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.tag }}](https://github.com/advplyr/audiobookshelf/releases/tag/${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.tag }})
No changes on the Windows side.
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./audiobookshelf-windows/Setup/Output/AudiobookshelfInstaller.exe
asset_name: AudiobookshelfInstaller.${{ github.event_name == 'repository_dispatch' && steps.get_latest_release.outputs.result || inputs.tag }}.exe
asset_content_type: application/x-msdownload