Repository navigation
79 lines (68 loc) · 2.71 KB
/
Copy pathrelease-java-sdk.yml
File metadata and controls
79 lines (68 loc) · 2.71 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
# Releases the official Java plugin SDK (`sdk/java`) through its own tag series
# (`sdk-java-v<version>`). The release holds `lithe-plugin-sdk-java-<version>.jar`
# and its `.sha256`; plugin repositories pin both and shade the JAR into their
# backend at build time.
name: Release Java Plugin SDK
on:
push:
tags:
- "sdk-java-v*"
permissions:
contents: read
concurrency:
group: release-java-plugin-sdk-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
name: Release ${{ github.ref_name }}
if: github.repository == 'Lithe-IDEA/lithe-plugin-docs'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
steps:
- name: Check out source
uses: actions/checkout@v7
# The SDK supports Java 8: the tests run on a Java 8 runtime, while
# Maven builds with the newer JDK set up last.
- name: Set up Java 8 runtime
id: java8
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '8'
- name: Set up Java 21 for Maven
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Require the tag to match the SDK version
id: version
env:
TAG: ${{ github.ref_name }}
run: |
version=$(mvn -B -ntp -q -f sdk/java/plugin-sdk/pom.xml help:evaluate -Dexpression=project.version -DforceStdout)
test "$TAG" = "sdk-java-v$version" || { echo "Tag $TAG does not match sdk/java version $version"; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Build and test on Java 8
env:
JAVA8: ${{ steps.java8.outputs.path }}/bin/java
run: mvn -B -ntp -f sdk/java/pom.xml verify -Djvm="$JAVA8"
- name: Collect the release assets
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
mkdir -p dist
asset="lithe-plugin-sdk-java-$VERSION.jar"
cp "sdk/java/plugin-sdk/target/$asset" "dist/$asset"
(cd dist && sha256sum "$asset" | cut -d' ' -f1 > "$asset.sha256")
- name: Publish the SDK release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
VERSION: ${{ steps.version.outputs.version }}
run: |
asset="lithe-plugin-sdk-java-$VERSION.jar"
gh release create "$TAG" "dist/$asset" "dist/$asset.sha256" \
--title "Java plugin SDK $VERSION" \
--notes "Official Java plugin SDK $VERSION for Lithe plugin backends. Requires Java 8 or newer and has no runtime dependencies. Pin the JAR by its SHA-256 (\`$asset.sha256\`) and shade it into the backend JAR; see sdk/java/README.md."