-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (107 loc) · 3.14 KB
/
Copy pathrelease.yml
File metadata and controls
124 lines (107 loc) · 3.14 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
name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: write
jobs:
build-vsix:
strategy:
matrix:
include:
- rid: osx-arm64
target: darwin-arm64
- rid: osx-x64
target: darwin-x64
- rid: linux-x64
target: linux-x64
- rid: win-x64
target: win32-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Build CLI (${{ matrix.rid }})
run: |
dotnet publish src/Nap.Cli/Nap.Cli.fsproj \
-r ${{ matrix.rid }} \
--self-contained \
-p:PublishTrimmed=true \
-p:PublishSingleFile=true \
-o src/Nap.VsCode/bin \
--nologo
- name: Install extension dependencies
working-directory: src/Nap.VsCode
run: npm ci
- name: Compile extension
working-directory: src/Nap.VsCode
run: npx webpack --mode production
- name: Package VSIX (${{ matrix.target }})
working-directory: src/Nap.VsCode
run: npx @vscode/vsce package --target ${{ matrix.target }} --no-dependencies --skip-license
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: vsix-${{ matrix.target }}
path: src/Nap.VsCode/*.vsix
build-cli:
strategy:
matrix:
include:
- rid: osx-arm64
asset: napper-osx-arm64
- rid: osx-x64
asset: napper-osx-x64
- rid: linux-x64
asset: napper-linux-x64
- rid: win-x64
asset: napper-win-x64.exe
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Publish CLI (${{ matrix.rid }})
run: |
dotnet publish src/Nap.Cli/Nap.Cli.fsproj \
-r ${{ matrix.rid }} \
--self-contained \
-p:PublishTrimmed=true \
-p:PublishSingleFile=true \
-o out/${{ matrix.rid }} \
--nologo
- name: Prepare asset
run: |
if [ "${{ matrix.rid }}" = "win-x64" ]; then
mv out/${{ matrix.rid }}/napper.exe ${{ matrix.asset }}
else
mv out/${{ matrix.rid }}/napper ${{ matrix.asset }}
chmod +x ${{ matrix.asset }}
fi
- name: Upload CLI binary
uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.rid }}
path: ${{ matrix.asset }}
release:
needs: [build-vsix, build-cli]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: assets
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: assets/*