-
Notifications
You must be signed in to change notification settings - Fork 2
128 lines (110 loc) · 3.5 KB
/
pub.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
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
name: Publish Release
env:
BuildDir: ./bld
ScriptDir: ./scripts
Product: HawDict
Prerelease: false
on:
push:
tags:
- 'v*'
defaults:
run:
shell: pwsh
jobs:
pub_create_github_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Release Notes
run: ${{ env.ScriptDir }}/CreateReleaseNotes.ps1
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.Product }} ${{ github.ref }}
body_path: ${{ env.BuildDir }}/ReleaseNotes.md
draft: false
prerelease: ${{ env.Prerelease }}
pub_build_windows:
name: Publish Windows Build
runs-on: windows-latest
needs: pub_create_github_release
strategy:
matrix:
target: [Unpacked, Win32, Win64]
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.target }}
run: ${{ env.ScriptDir }}/Build${{ matrix.target }}.ps1
- name: Upload ${{ matrix.target }} Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.pub_create_github_release.outputs.upload_url }}
asset_path: ${{ env.BuildDir }}/${{ env.Product }}.${{ matrix.target }}.zip
asset_name: ${{ env.Product }}.${{ matrix.target }}.zip
asset_content_type: application/zip
pub_build_linux:
name: Publish Linux Build
runs-on: ubuntu-latest
needs: pub_create_github_release
strategy:
matrix:
target: [Linux]
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.target }}
run: ${{ env.ScriptDir }}/Build${{ matrix.target }}.ps1
- name: Upload ${{ matrix.target }} Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.pub_create_github_release.outputs.upload_url }}
asset_path: ${{ env.BuildDir }}/${{ env.Product }}.${{ matrix.target }}.tar.gz
asset_name: ${{ env.Product }}.${{ matrix.target }}.tar.gz
asset_content_type: application/gzip
pub_build_macos:
name: Publish MacOS Build
runs-on: macOS-latest
needs: pub_create_github_release
strategy:
matrix:
target: [MacOS]
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.target }}
run: ${{ env.ScriptDir }}/Build${{ matrix.target }}.ps1
- name: Upload ${{ matrix.target }} Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.pub_create_github_release.outputs.upload_url }}
asset_path: ${{ env.BuildDir }}/${{ env.Product }}.${{ matrix.target }}.tar.gz
asset_name: ${{ env.Product }}.${{ matrix.target }}.tar.gz
asset_content_type: application/gzip