forked from redhat-developer/vscode-java
-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (148 loc) · 5.86 KB
/
javac-upload.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
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
name: javac-upload
on:
schedule:
- cron: '0 */8 * * *'
workflow_dispatch:
jobs:
should-build-change:
runs-on: ubuntu-latest
outputs:
repo-cache-hit: ${{ steps.cache-last-commit.outputs.cache-hit }}
steps:
- name: Checkout eclipse-jdt-core-incubator
uses: actions/checkout@v4
with:
repository: 'eclipse-jdtls/eclipse-jdt-core-incubator'
ref: 'dom-with-javac'
path: eclipse-jdt-core-incubator
- name: Checkout eclipse.jdt.ls
uses: actions/checkout@v4
with:
repository: 'eclipse-jdtls/eclipse.jdt.ls'
path: eclipse.jdt.ls
- name: Checkout vscode-java
uses: actions/checkout@v4
with:
repository: 'redhat-developer/vscode-java'
path: vscode-java
- name: Compute changes hash
run: |
pushd eclipse-jdt-core-incubator
git rev-parse HEAD >> ../lastCommit
popd
pushd eclipse.jdt.ls
git rev-parse HEAD >> ../lastCommit
popd
pushd vscode-java
git rev-parse HEAD >> ../lastCommit
- name: Check New Changes
id: cache-last-commit
uses: actions/cache@v4
with:
path: lastCommit
key: lastCommit-${{ hashFiles('lastCommit') }}
build-javac-support:
runs-on: ubuntu-latest
needs: should-build-change
if: ${{ needs.should-build-change.outputs.repo-cache-hit != 'true' || github.event_name != 'schedule' }}
steps:
- name: Checkout eclipse-jdt-core-incubator
uses: actions/checkout@v4
with:
repository: 'eclipse-jdtls/eclipse-jdt-core-incubator'
ref: 'dom-with-javac'
path: eclipse-jdt-core-incubator
- name: Checkout eclipse.jdt.ls
uses: actions/checkout@v4
with:
repository: 'eclipse-jdtls/eclipse.jdt.ls'
fetch-depth: 50
path: eclipse.jdt.ls
- name: Checkout vscode-java
uses: actions/checkout@v4
with:
repository: 'redhat-developer/vscode-java'
fetch-depth: 50
path: vscode-java
- name: Set Up Java
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: 23
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.8
- name: Build JDT Core / Javac
run: |
ls -ll
cd eclipse-jdt-core-incubator
echo "INCUBATOR_SHORT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "INCUBATOR_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
mvn -pl '!org.eclipse.jdt.core.tests.builder,!org.eclipse.jdt.core.tests.compiler,!org.eclipse.jdt.core.tests.javac,!org.eclipse.jdt.core.tests.model,!org.eclipse.jdt.core.tests.performance,!org.eclipse.jdt.compiler.tool.tests,!org.eclipse.jdt.compiler.apt.tests,!org.eclipse.jdt.apt.ui,!org.eclipse.jdt.apt.tests,!org.eclipse.jdt.apt.pluggable.tests' install -DskipTests
cd ..
- name: Apply JDT-LS changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "VS Code Java"
cd eclipse.jdt.ls
gh pr checkout https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/3123
git rebase master
cd ..
env:
GH_TOKEN: ${{ github.token }}
- name: Apply VS Code Java changes
run: |
cd vscode-java
gh pr checkout https://github.com/redhat-developer/vscode-java/pull/3558
git rebase master
env:
GH_TOKEN: ${{ github.token }}
- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install NodeJS dependencies
run: npm install -g typescript "@vscode/vsce"
- name: Install vscode-java dependencies
run: |
pwd
cd vscode-java
npm ci
- name: Build JDT-LS
run: |
pwd
cd vscode-java
rm -rf ./out
npm run build-server
echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
- name: Prepare Lombok Support
run: |
pwd
cd vscode-java
npx gulp download_lombok
- name: Package vscode-java
run: |
pwd
cd vscode-java
npx gulp prepare_pre_release
vsce package --pre-release -o vscode-javac-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
ls -lash *.vsix
echo "BUILD_DATE=$(date +'%d/%m/%Y')" >> $GITHUB_ENV
- name: Publish to GH Release Tab
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0"
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "javac-prototype"
prerelease: true
title: "Prototype build with Javac support (${{env.BUILD_DATE}})"
files: |
vscode-java/*.vsix
- name: Update release description
run: |
cd vscode-java
echo -e 'Enable javac-based compilation in vscode-java with `"java.jdt.ls.javac.enabled":"on"` in your VS Code settings.\nRequires running the extension with JDK 23 (set `java.jdt.ls.java.home`).\n\nBuilt from:\n\n - jdt.core.incubator: commit [${{env.INCUBATOR_SHORT_COMMIT}}](https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/commit/${{env.INCUBATOR_COMMIT}})\n - jdt.ls: https://github.com/eclipse-jdtls/eclipse-jdt.ls/pull/3123 rebased on master\n - vscode-java: https://github.com/redhat-developer/vscode-java/pull/3558 rebased on master' > notes.md
cat notes.md
gh -R fbricon/vscode-java release edit javac-prototype -F notes.md
env:
GH_TOKEN: ${{ github.token }}