-
Notifications
You must be signed in to change notification settings - Fork 720
115 lines (101 loc) · 4.57 KB
/
Copy pathlspDeploy.yml
File metadata and controls
115 lines (101 loc) · 4.57 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
name: Vespa Schema LSP - Deploy extension
on:
workflow_dispatch:
inputs:
version:
type: choice
description: Which kind of release is this
required: true
options:
- patch
- minor
- major
pull_request:
paths:
- 'integration/schema-language-server/**'
- '.github/workflows/lspDeploy.yml'
jobs:
lspBuildAndDeploy:
name: Vespa Schema LSP Build and Deploy
# Note: While this job declares 'contents: write', step-level conditionals ensure
# write operations only execute on workflow_dispatch. For forked PRs, GitHub also
# automatically restricts tokens to read-only regardless of declared permissions.
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Build Vespa
run: |
export MAVEN_OPTS="-Xms128m -Xmx1024m"
./bootstrap.sh java
mvn install --threads 1C -Pschema-language-server -DskipTests -Dmaven.source.skip -Dmaven.javadoc.skip -Denforcer.skip
working-directory: ./
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Download node dependencies
run: npm ci
working-directory: ./integration/schema-language-server/clients/vscode
# Deployment steps below only run on workflow_dispatch
- name: "Retrieve version"
id: retrieve_version
if: github.event_name == 'workflow_dispatch'
working-directory: ./integration/schema-language-server/utils
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 updateVersion.py ${{ github.event.inputs.version }} >> $GITHUB_OUTPUT
- name: Build IntelliJ plugin
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo ${{ steps.retrieve_version.outputs.VERSION }} > VERSION
fi
gradle buildPlugin
working-directory: ./integration/schema-language-server/clients/intellij
- name: Publish VScode extension
if: github.event_name == 'workflow_dispatch'
run: npm run publish
continue-on-error: true
working-directory: ./integration/schema-language-server/clients/vscode
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish IntelliJ plugin
if: github.event_name == 'workflow_dispatch'
run: |
curl -i --header "Authorization: Bearer $INTELLIJ_PLUGIN_PERM" -F pluginId=$PLUGIN_ID -F file=@./build/distributions/vespa-$VERSION.zip https://plugins.jetbrains.com/plugin/uploadPlugin
working-directory: ./integration/schema-language-server/clients/intellij
env:
VERSION: ${{ steps.retrieve_version.outputs.VERSION }}
INTELLIJ_PLUGIN_PERM: ${{ secrets.INTELLIJ_PLUGIN_PERM }}
PLUGIN_ID: 18074
- name: Publish to open-vsx
if: github.event_name == 'workflow_dispatch'
working-directory: ./integration/schema-language-server/clients/vscode
run: npx ovsx publish 'vespa-language-support-${{ steps.retrieve_version.outputs.VERSION }}.vsix' -p ${{ secrets.OPEN_VSX_PAT }}
- name: Prepare Github Release
if: github.event_name == 'workflow_dispatch'
working-directory: ./integration/schema-language-server
run: |
mkdir -p ./clients/github-release/target
cp ./language-server/target/schema-language-server-jar-with-dependencies.jar ./clients/github-release/target/vespa-language-server_$VERSION.jar
env:
VERSION: ${{ steps.retrieve_version.outputs.VERSION }}
- name: Create release
if: github.event_name == 'workflow_dispatch'
working-directory: ./integration/schema-language-server
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "## What's New" | cat ./clients/github-release/README.md.in - ./resources/CHANGENOTES.txt > ./clients/github-release/README.md
gh release create lsp-v${{ steps.retrieve_version.outputs.VERSION }} \
--notes-file ./clients/github-release/README.md \
--latest=false \
-t "Vespa Language Server ${{ steps.retrieve_version.outputs.VERSION }}" \
'./clients/github-release/target/vespa-language-server_${{ steps.retrieve_version.outputs.VERSION }}.jar' \
'./clients/vscode/vespa-language-support-${{ steps.retrieve_version.outputs.VERSION }}.vsix'