-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (50 loc) · 2.01 KB
/
pre-release.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
name: Pre-release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
pre-release:
runs-on: ubuntu-latest
name: Build vsix and upload to GitHub pre-release
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0"
- name: Get current version
run: |
VERSION=$(node -p "require('./package.json').version")
echo VERSION=$VERSION >> $GITHUB_ENV
echo VERSION_TAG=v$VERSION-${{ github.run_number }} >> $GITHUB_ENV
- name: Add GitHub NuGet Registry
run: dotnet nuget add source --username "${{ github.actor }}" --password "%GITHUB_TOKEN%" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GeoWerkstatt/index.json"
- name: Restore packages
run: dotnet restore ./language-server/src
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build language-server
run: dotnet build --no-restore "-p:VersionPrefix=${{ env.VERSION }}" ./language-server/src
- name: Run language-server tests
run: dotnet test --no-build ./language-server/src
- name: Publish language-server
run: |
for rid in win-x64 linux-x64 osx-x64
do
dotnet publish ./language-server/src/Geowerkstatt.Interlis.LanguageServer --self-contained -c Release -r $rid "-p:VersionPrefix=${{ env.VERSION }}" -o ./language-server/bin/$rid
done
- name: Install packages
run: npm ci
- name: Pack extension
run: npx vsce pack --pre-release
- name: Create GitHub pre-release
run: gh release create ${{ env.VERSION_TAG }} --title "${{ env.VERSION_TAG }}" --notes "$(./get-changelog.sh)" --prerelease --target ${{ github.ref }} *.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}