-
Notifications
You must be signed in to change notification settings - Fork 10
168 lines (138 loc) · 5.23 KB
/
release.yml
File metadata and controls
168 lines (138 loc) · 5.23 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Release
on:
push:
tags:
- 'v*'
jobs:
tests:
uses: ./.github/workflows/dotnet-test.yml
package:
name: Package NuGet Packages
needs: [tests]
runs-on: ubuntu-latest
env:
DevBuild: 'false'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install WASI SDK
uses: konsumer/install-wasi-sdk@v1
with:
version: "27"
- name: Setup Binaryen
uses: ./.github/actions/setup-binaryen
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup WABT
uses: ./.github/actions/setup-wabt
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.0.x
9.0.x
dotnet-quality: 'preview'
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME:1}" >> $GITHUB_OUTPUT
- name: Build engine
working-directory: hosts/dotnet/scripts
run: ./build-engine.sh
- name: Restore solution
working-directory: hosts/dotnet
run: dotnet restore
- name: Pack Hako
working-directory: hosts/dotnet/Hako
run: dotnet pack -c Release /p:Packing=true /p:HakoVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Pack Hako.Backend
working-directory: hosts/dotnet/Hako.Backend
run: dotnet pack -c Release /p:Packing=true /p:HakoVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Pack Hako.Backend.Wasmtime
working-directory: hosts/dotnet/Hako.Backend.Wasmtime
run: dotnet pack -c Release /p:Packing=true /p:HakoVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Pack Hako.Backend.WACS
working-directory: hosts/dotnet/Hako.Backend.WACS
run: dotnet pack -c Release /p:Packing=true /p:HakoVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Pack Hako.Analyzers
working-directory: hosts/dotnet/Hako.Analyzers
run: dotnet pack -c Release /p:Packing=true /p:HakoVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Pack Hako.SourceGenerator
working-directory: hosts/dotnet/Hako.SourceGenerator
run: dotnet pack -c Release /p:Packing=true /p:HakoVersion=${{ steps.version.outputs.VERSION }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: |
hosts/dotnet/**/bin/Release/*.nupkg
hosts/dotnet/**/bin/Release/*.snupkg
retention-days: 30
if-no-files-found: error
create-release:
name: Create GitHub Release
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get tag name
id: tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Download packages
uses: actions/download-artifact@v4
with:
name: nuget-packages
path: packages
- name: Generate checksums
run: |
cd packages
find . -name "*.nupkg" -o -name "*.snupkg" | xargs shasum -a 256 > checksums.txt
cat checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: |
packages/**/*.nupkg
packages/**/*.snupkg
packages/checksums.txt
body: |
## Hako ${{ steps.tag.outputs.TAG_NAME }}
### .NET Packages
Install via NuGet:
```bash
dotnet add package Hako --version ${{ steps.tag.outputs.TAG_NAME }}
dotnet add package Hako.Backend.Wasmtime --version ${{ steps.tag.outputs.TAG_NAME }}
```
### Packages Included
- `Hako` - Core JavaScript engine
- `Hako.Backend` - Backend abstraction
- `Hako.Backend.Wasmtime` - [wasmtime](https://wasmtime.dev/) backend
- `Hako.Backend.WACS` - [WACS](https://github.com/kelnishi/WACS) backend
- `Hako.Analyzers` - Roslyn analyzers
- `Hako.SourceGenerator` - Source generators for bindings
### Checksums
See `checksums.txt` for SHA-256 checksums of all packages.
draft: false
prerelease: false
publish:
name: Publish to NuGet
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: nuget-packages
path: packages
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Publish to NuGet
run: |
for package in packages/**/*.nupkg packages/**/*.snupkg; do
dotnet nuget push "$package" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
done