Skip to content

Commit 3470750

Browse files
chore: update minimum deps & update release process [IDE-356] (#176)
* chore: update minimum dependencies & fix lsp4e interface call * chore: update release process * chore: bump plugin version * chore: update ci.yml github action to use newer actions * fix: use secret for sha check of keystore * refactor: enforce max number of parameters * fix: script output * fix: add recursive flag to aws cp call
1 parent 3bbd12e commit 3470750

16 files changed

Lines changed: 139 additions & 103 deletions

File tree

.github/upload-to-s3.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
#
3+
# © 2024 Snyk Limited
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
set -euo pipefail
19+
20+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
21+
# shellcheck disable=SC2002
22+
BASE="eclipse"
23+
AWS_REGION="${AWS_REGION:-us-east-1}"
24+
AWS_S3_BUCKET_NAME="${AWS_S3_BUCKET_NAME:-snyk-test}"
25+
DRY_RUN=
26+
27+
if [ $# -eq 0 ]; then
28+
echo "please provide a release channel as parameter (preview/stable)"
29+
exit 1
30+
fi
31+
32+
RELEASE_CHANNEL=$1
33+
34+
if [ $# -eq 2 ]; then
35+
DRY_RUN=--dryrun
36+
fi
37+
38+
if [ $# -gt 2 ]; then
39+
echo "Too many parameters"
40+
echo "Usage: upload-to-s3.sh <release-channel> <dryrun>"
41+
exit 1
42+
fi
43+
44+
function uploadFile() {
45+
FILENAME_SRC=$1
46+
FILENAME_DST=$2
47+
DRY_RUN=${3:-}
48+
49+
[ ! -d "$FILENAME_SRC" ] && echo "Directory $FILENAME_SRC does not exist." && exit 1
50+
51+
# shellcheck disable=SC2086
52+
aws s3 cp --recursive $DRY_RUN "$FILENAME_SRC" "s3://$AWS_S3_BUCKET_NAME/$BASE/$FILENAME_DST"
53+
}
54+
55+
# publish repo
56+
FILENAME_SRC="$SCRIPT_DIR/../update-site/target/repository"
57+
FILENAME_DST="$RELEASE_CHANNEL"
58+
# shellcheck disable=SC2086
59+
uploadFile $FILENAME_SRC $FILENAME_DST $DRY_RUN

.github/workflows/ci.yml

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,54 @@ name: Build Plugin with Maven
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [main]
99
pull_request:
10-
branches: [ main ]
10+
branches: [main]
1111

1212
jobs:
1313
build:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [ ubuntu-latest, macos-latest, windows-latest ]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up JDK
21-
uses: actions/setup-java@v2
22-
with:
23-
java-version: '17'
24-
distribution: 'zulu'
25-
cache: maven
26-
27-
- name: Decode Keystore
28-
id: decode_keystore
29-
if: ${{ matrix.os == 'ubuntu-latest' }}
30-
env:
31-
fileName: ./keystore.jks
32-
encodedString: ${{ secrets.KEYSTORE }}
33-
run: |
34-
echo "$encodedString" | base64 -d > $fileName
35-
echo "6cab9fa86689a9969097a662891fe8a1d8752ac430c18750cfa4d230744ac4a7 $fileName" > sha256.txt
36-
sha256sum -c sha256.txt
37-
38-
- name: Build with Maven
39-
if: ${{ matrix.os == 'ubuntu-latest' }}
40-
run: ./mvnw clean verify -P sign -DtrimStackTrace=false
41-
env:
42-
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
43-
44-
- name: Build with Maven
45-
if: ${{ matrix.os != 'ubuntu-latest' }}
46-
run: |
47-
./mvnw clean verify -DtrimStackTrace=false
48-
49-
- name: Authenticate to GCS
50-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
51-
id: 'auth'
52-
uses: 'google-github-actions/auth@v0'
53-
with:
54-
credentials_json: '${{ secrets.gcp_credentials_2 }}'
55-
56-
- name: Publish to Marketplace bucket
57-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
58-
uses: 'google-github-actions/upload-cloud-storage@v0'
59-
with:
60-
path: "./update-site/target/repository/"
61-
destination: "snyk-eclipse-plugin-test/preview-2.1"
62-
predefinedAcl: publicRead
19+
- uses: actions/checkout@v4
20+
- name: Set up JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: "17"
24+
distribution: "temurin"
25+
cache: maven
26+
27+
- name: Decode Keystore
28+
id: decode_keystore
29+
if: ${{ matrix.os == 'ubuntu-latest' }}
30+
env:
31+
fileName: ./keystore.jks
32+
encodedString: ${{ secrets.KEYSTORE }}
33+
sha: ${{ secrets.KEYSTORE_SHA }}
34+
run: |
35+
echo "$encodedString" | base64 -d > $fileName
36+
echo "$sha $fileName" > sha256.txt
37+
sha256sum -c sha256.txt
38+
39+
- name: Build with Maven
40+
if: ${{ matrix.os == 'ubuntu-latest' }}
41+
run: ./mvnw clean verify -P sign -DtrimStackTrace=false
42+
env:
43+
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
44+
45+
- name: Build with Maven
46+
if: ${{ matrix.os != 'ubuntu-latest' }}
47+
run: |
48+
./mvnw clean verify -DtrimStackTrace=false
49+
50+
- name: Upload binaries to static.snyk.io
51+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
55+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
56+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
57+
run: |
58+
.github/upload-to-s3.sh preview

.github/workflows/release.yml

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ name: Release
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 9 * * 2' # every Tuesday at 9 am UTC
6+
- cron: "0 9 * * 2" # every Tuesday at 9 am UTC
77

88
jobs:
99
release:
1010
name: release
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Fetch Sources
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717

1818
- name: Set up JDK
19-
uses: actions/setup-java@v2
19+
uses: actions/setup-java@v4
2020
with:
21-
java-version: '17'
22-
distribution: 'zulu'
21+
java-version: "17"
22+
distribution: "temurin"
2323
cache: maven
2424

2525
- name: Decode Keystore
@@ -49,43 +49,16 @@ jobs:
4949
git push --tags
5050
echo "::set-output name=tagName::$TAG_NAME"
5151
52-
- name: Authenticate to GCS
53-
id: 'auth'
54-
uses: 'google-github-actions/auth@v0'
55-
with:
56-
credentials_json: '${{ secrets.gcp_credentials_2 }}'
57-
58-
- name: Publish to Marketplace bucket
59-
uses: 'google-github-actions/upload-cloud-storage@v0'
60-
with:
61-
path: "./update-site/target/repository/"
62-
destination: "snyk-eclipse-plugin/weekly-2.1"
63-
predefinedAcl: publicRead
64-
65-
- name: Extract release notes
66-
id: extract-release-notes
67-
uses: ffurrer2/extract-release-notes@v1
68-
6952
- name: Create release
70-
id: create_release
7153
if: ${{ !env.ACT }}
72-
uses: actions/create-release@v1
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
with:
76-
tag_name: "${{ steps.createTag.outputs.tagName }}"
77-
release_name: "${{ steps.createTag.outputs.tagName }}"
78-
draft: false
79-
prerelease: false
80-
body: '${{ steps.extract-release-notes.outputs.release_notes }}'
54+
id: create_release
55+
run: gh release create ${{ steps.createTag.outputs.tagName }} --generate-notes $(find . -name 'update-site-*.zip')
8156

82-
- name: Upload Release Asset
83-
id: upload-release-asset
84-
uses: actions/upload-release-asset@v1
57+
- name: Upload binaries to static.snyk.io
8558
env:
8659
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
with:
88-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
89-
asset_path: ./update-site/target/update-site-2.1.0-SNAPSHOT.zip
90-
asset_name: "update-site-2.1.0-${{ steps.createTag.outputs.tagName }}.zip"
91-
asset_content_type: application/zip
60+
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
61+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
62+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
63+
run: |
64+
.github/upload-to-s3.sh stable

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Snyk Security Changelog
22

3+
## [2.2.0] - Unreleased
4+
### Changes
5+
- require lsp4e 0.18.9 and lsp4j 0.23.1 as minimum versions
6+
- update release process & update sites to https://static.snyk.io/eclipse/preview and https://static.snyk.io/eclipse/stable
37

4-
## [2.1.0] - Unreleased
8+
## [2.1.0] - v20240412.114323
9+
### Changes
10+
- bumped the LS protocol version to 11 to support new commands introduced for global ignores
11+
12+
## [2.1.0] - v20240313.174439
513

614
### Changes
715
- bumped the LS protocol version to 11 to support new commands introduced for global ignores

feature/category.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<feature url="features/io.snyk.scanner_2.1.0.qualifier.jar" id="io.snyk.scanner" version="2.1.0.qualifier">
3+
<feature url="features/io.snyk.scanner_2.2.0.qualifier.jar" id="io.snyk.scanner" version="2.2.0.qualifier">
44
<category name="io.snyk.scanner"/>
55
</feature>
66
<category-def name="io.snyk.scanner" label="Snyk Security">

feature/feature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<feature
33
id="io.snyk.scanner"
44
label="Snyk Security"
5-
version="2.1.0.qualifier"
5+
version="2.2.0.qualifier"
66
provider-name="Snyk">
77

88
<description url="https://snyk.io">

feature/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.snyk</groupId>
66
<artifactId>parent</artifactId>
7-
<version>2.1.0-SNAPSHOT</version>
7+
<version>2.2.0-SNAPSHOT</version>
88
</parent>
99

1010
<artifactId>io.snyk.scanner</artifactId>

plugin/META-INF/MANIFEST.MF

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-RequiredExecutionEnvironment: JavaSE-17
55
Bundle-SymbolicName: io.snyk.eclipse.plugin;singleton:=true
6-
Bundle-Version: 2.1.0.qualifier
6+
Bundle-Version: 2.2.0.qualifier
77
Bundle-Activator: io.snyk.eclipse.plugin.Activator
88
Bundle-Vendor: %Bundle-Vendor
99
Require-Bundle: org.eclipse.ui,
1010
org.eclipse.core.runtime,
1111
org.eclipse.jdt.core,
1212
org.eclipse.core.resources,
13-
org.eclipse.lsp4e;bundle-version="0.17.0",
14-
org.eclipse.lsp4e.jdt,
13+
org.eclipse.lsp4e;bundle-version="0.18.9",
14+
org.eclipse.lsp4e.jdt;bundle-version="0.13.0",
1515
org.eclipse.equinox.security,
1616
org.eclipse.equinox.security.ui,
17-
org.eclipse.lsp4j,
17+
org.eclipse.lsp4j;bundle-version="0.23.1",
1818
org.eclipse.core.filebuffers,
1919
org.eclipse.ui.workbench.texteditor,
2020
org.eclipse.jface.text,

plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.snyk</groupId>
77
<artifactId>parent</artifactId>
8-
<version>2.1.0-SNAPSHOT</version>
8+
<version>2.2.0-SNAPSHOT</version>
99
</parent>
1010

1111

plugin/src/main/java/io/snyk/eclipse/plugin/SnykStartup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void startLanguageServer() {
8686
var definition = LanguageServersRegistry.getInstance().getDefinition(SnykLanguageServer.LANGUAGE_SERVER_ID);
8787
try {
8888
LanguageServiceAccessor.startLanguageServer(definition);
89-
} catch (IOException e) {
89+
} catch (RuntimeException e) {
9090
logError(e);
9191
}
9292
}

0 commit comments

Comments
 (0)