Skip to content

Commit 057ed30

Browse files
authored
Update GitHub Actions to v4 where applicable. (#969)
* Update GitHub Actions to v4 where applicable. * Add --skip-duplicate flag to vsce/ovsx in case re-release is necessary. - The most common case for this is some kind of failure in the marketplace to correctly respond to publishing one of platform specific artifacts, which fails the build (eg. timeout failure). --------- Signed-off-by: Roland Grunberg <[email protected]>
1 parent fb0d934 commit 057ed30

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

.github/workflows/native-image.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
xml-server-version: ${{ steps.setup-xml-version.outputs.XML_SERVER_VERSION }}
1515
steps:
1616
- name: Check Out VS Code XML
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
- id: setup-xml-version
1919
run: echo "XML_SERVER_VERSION=$(cat package.json | jq -r .xmlServer.version)" >> $GITHUB_OUTPUT
2020
build-binary-unix:
@@ -35,12 +35,12 @@
3535
- os: ubuntu-20.04
3636
label: 'linux'
3737
steps:
38-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v4
3939
with:
4040
repository: 'eclipse/lemminx'
4141
ref: ${{ inputs.publishPreRelease == 'true' && 'main' || needs.setup-xml-version.outputs.xml-server-version }}
4242
- name: Cache Maven dependencies
43-
uses: actions/cache@v2
43+
uses: actions/cache@v4
4444
with:
4545
path: |
4646
~/.m2/repository
@@ -50,7 +50,7 @@
5050
restore-keys: |
5151
${{ runner.os }}-maven-
5252
- name: Cache GraalVM
53-
uses: actions/cache@v2
53+
uses: actions/cache@v4
5454
with:
5555
path: |
5656
/opt/hostedtoolcache/graalvm-jdk-*
@@ -64,7 +64,7 @@
6464
java-version: ${{env.GRAALVM_JAVA}}
6565
- run: ./mvnw -B package -Dnative -DskipTests $([ $(uname -s) = Linux ] && echo "-Dgraalvm.static=-H:+StaticExecutableWithDynamicLibC") -Dcbi.jarsigner.skip=true
6666
- run: mv org.eclipse.lemminx/target/lemminx-* lemminx-${{ matrix.label }}
67-
- uses: actions/upload-artifact@v3
67+
- uses: actions/upload-artifact@v4
6868
with:
6969
name: lemminx-${{ matrix.label }}
7070
path: lemminx-${{ matrix.label }}
@@ -77,12 +77,12 @@
7777
GRAALVM_JAVA: 17
7878
steps:
7979
- name: Check out LemMinX
80-
uses: actions/checkout@v2
80+
uses: actions/checkout@v4
8181
with:
8282
repository: 'eclipse/lemminx'
8383
ref: ${{ inputs.publishPreRelease == 'true' && 'main' || needs.setup-xml-version.outputs.xml-server-version }}
8484
- name: Cache Maven dependencies
85-
uses: actions/cache@v2
85+
uses: actions/cache@v4
8686
with:
8787
path: |
8888
~/.m2/repository
@@ -92,7 +92,7 @@
9292
restore-keys: |
9393
${{ runner.os }}-maven-
9494
- name: Cache GraalVM
95-
uses: actions/cache@v2
95+
uses: actions/cache@v4
9696
with:
9797
path: |
9898
C:\hostedtoolcache\windows\graalvm-ce-*
@@ -106,7 +106,7 @@
106106
java-version: ${{env.GRAALVM_JAVA}}
107107
- run: .\mvnw.cmd -B package -Dnative -DskipTests -D "cbi.jarsigner.skip=true"
108108
- run: mv org.eclipse.lemminx\target\lemminx-*.exe lemminx-win32.exe
109-
- uses: actions/upload-artifact@v3
109+
- uses: actions/upload-artifact@v4
110110
with:
111111
name: lemminx-win32
112112
path: lemminx-win32.exe

.github/workflows/release.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
outputs:
3636
repo-cache-hit: ${{ steps.cache-last-commit.outputs.cache-hit }}
3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3939
with:
4040
repository: 'eclipse/lemminx'
4141
fetch-depth: 2
4242
path: lemminx
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
with:
4545
repository: 'redhat-developer/vscode-xml'
4646
fetch-depth: 2
@@ -53,14 +53,14 @@ jobs:
5353
git rev-parse HEAD >> ../lastCommit
5454
- name: Check New Changes
5555
id: cache-last-commit
56-
uses: actions/cache@v2
56+
uses: actions/cache@v4
5757
with:
5858
path: lastCommit
5959
key: lastCommit-${{ hashFiles('lastCommit') }}
6060
build-binaries-job:
6161
needs: should-build-change
6262
if: ${{ needs.should-build-change.outputs.repo-cache-hit != 'true' || github.event_name != 'schedule' }}
63-
uses: redhat-developer/vscode-xml/.github/workflows/native-image.yaml@main
63+
uses: rgrunber/vscode-xml/.github/workflows/native-image.yaml@main
6464
with:
6565
publishPreRelease: ${{ github.event_name == 'schedule' || inputs.publishPreRelease == 'true' }}
6666
packaging-job:
@@ -69,7 +69,7 @@ jobs:
6969
steps:
7070
- name: Checkout LemMinX
7171
if: "${{ github.event_name == 'schedule' || inputs.publishPreRelease == 'true' }}"
72-
uses: actions/checkout@v2
72+
uses: actions/checkout@v4
7373
with:
7474
repository: eclipse/lemminx
7575
- name: Build LemMinX Server Uber Jar
@@ -79,9 +79,9 @@ jobs:
7979
mkdir ../staging
8080
cp org.eclipse.lemminx/target/org.eclipse.lemminx*-uber.jar ../staging
8181
- name: Check Out VS Code XML
82-
uses: actions/checkout@v2
82+
uses: actions/checkout@v4
8383
- name: Set Up NodeJS
84-
uses: actions/setup-node@v2
84+
uses: actions/setup-node@v4
8585
with:
8686
node-version: '18'
8787
- name: Install dependencies
@@ -112,7 +112,7 @@ jobs:
112112
fi
113113
echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
114114
- name: Download LemMinX Binary Artifacts
115-
uses: actions/download-artifact@v3
115+
uses: actions/download-artifact@v4
116116
- name: Prepare Binary Artifacts For Packaging
117117
run: |
118118
mkdir -p ../staging/zips ../staging/checksums
@@ -142,13 +142,13 @@ jobs:
142142
vsce package ${{ env.publishPreReleaseFlag }} -o vscode-xml-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
143143
ls -lash *.vsix
144144
- name: Upload VSIX Artifacts
145-
uses: actions/upload-artifact@v2
145+
uses: actions/upload-artifact@v4
146146
with:
147147
name: vscode-xml
148148
path: vscode-xml*-${{ env.EXT_VERSION }}-${{github.run_number}}.vsix
149149
if-no-files-found: error
150150
- name: Upload LemMinX Uber Jar
151-
uses: actions/upload-artifact@v2
151+
uses: actions/upload-artifact@v4
152152
with:
153153
name: lemminx-uber-jar
154154
path: server/org.eclipse.lemminx*-uber.jar
@@ -170,9 +170,9 @@ jobs:
170170
needs: packaging-job
171171
steps:
172172
- name: Check Out VS Code XML
173-
uses: actions/checkout@v2
173+
uses: actions/checkout@v4
174174
- name: Set Up NodeJS
175-
uses: actions/setup-node@v2
175+
uses: actions/setup-node@v4
176176
with:
177177
node-version: '18'
178178
- name: Install dependencies
@@ -184,7 +184,7 @@ jobs:
184184
if: ${{ inputs.publishToMarketPlace == 'true' }}
185185
run: sed -i -e "s|${{ env.downloadLocation }}/releases/download/latest|${{ env.downloadLocation }}/releases/download/${{ env.XML_SERVER_VERSION }}|g" package.json
186186
- name: Download VSIX & LemMinX Server Uber Jar
187-
uses: actions/download-artifact@v3
187+
uses: actions/download-artifact@v4
188188
- name: Build vscode-xml
189189
run: |
190190
npm install
@@ -202,13 +202,13 @@ jobs:
202202
if: ${{ github.event_name == 'schedule' || inputs.publishToMarketPlace == 'true' || inputs.publishPreRelease == 'true' }}
203203
run: |
204204
for platformVsix in vscode-xml/vscode-xml-*-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix; do
205-
vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath ${platformVsix}
205+
vsce publish --skip-duplicate -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath ${platformVsix}
206206
done
207-
vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath vscode-xml/vscode-xml-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
207+
vsce publish --skip-duplicate -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath vscode-xml/vscode-xml-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
208208
- name: Publish to OpenVSX Registry
209209
if: ${{ github.event_name == 'schedule' || inputs.publishToOVSX == 'true' || inputs.publishPreRelease == 'true' }}
210210
run: |
211211
for platformVsix in vscode-xml/vscode-xml-*-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix; do
212-
ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath ${platformVsix}
212+
ovsx publish --skip-duplicate -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath ${platformVsix}
213213
done
214-
ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath vscode-xml/vscode-xml-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix
214+
ovsx publish --skip-duplicate -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath vscode-xml/vscode-xml-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix

0 commit comments

Comments
 (0)