Skip to content

Commit 803fb5d

Browse files
authored
Language Feature: Static generic class variables (#1097)
1 parent 5654ec4 commit 803fb5d

File tree

29 files changed

+1881
-250
lines changed

29 files changed

+1881
-250
lines changed

.github/workflows/build.yml

Lines changed: 87 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,97 @@
1-
name: Build Pipeline
1+
name: CI (build & test)
2+
23
on:
34
push:
4-
branches:
5-
- master
5+
branches: [ master ]
66
pull_request:
77
types: [opened, synchronize, reopened]
8+
9+
concurrency:
10+
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
813
jobs:
914
build:
10-
name: Build and analyze
11-
runs-on: ubuntu-latest
15+
name: Gradle build on ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, windows-latest]
20+
runs-on: ${{ matrix.os }}
21+
permissions:
22+
contents: read
23+
env:
24+
GRADLE_OPTS: -Dorg.gradle.daemon=false
25+
defaults:
26+
run:
27+
working-directory: de.peeeq.wurstscript
28+
1229
steps:
13-
- uses: actions/checkout@v3
30+
- name: Checkout
31+
uses: actions/checkout@v4
1432
with:
15-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16-
- name: Set up JDK 17
17-
uses: actions/setup-java@v3
33+
fetch-depth: 0
34+
35+
- name: Setup Temurin JDK 25
36+
uses: actions/setup-java@v4
1837
with:
19-
java-version: 25
20-
distribution: 'zulu' # Alternative distribution options are available
21-
- name: Cache Gradle packages
22-
uses: actions/cache@v3
38+
distribution: temurin
39+
java-version: '25'
40+
cache: 'gradle'
41+
42+
# Linux only: use a portable, pristine Temurin 25 for jlink
43+
- name: (Linux) Install portable Temurin 25
44+
if: runner.os == 'Linux'
45+
shell: bash
46+
run: |
47+
set -euo pipefail
48+
URL="https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25%2B36/OpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz"
49+
mkdir -p "$RUNNER_TEMP/temurin25"
50+
curl -fsSL "$URL" -o "$RUNNER_TEMP/temurin25/jdk.tar.gz"
51+
tar -xzf "$RUNNER_TEMP/temurin25/jdk.tar.gz" -C "$RUNNER_TEMP/temurin25"
52+
PORTABLE_JAVA_HOME="$(find "$RUNNER_TEMP/temurin25" -maxdepth 1 -type d -name 'jdk-25*' | head -n1)"
53+
echo "PORTABLE_JAVA_HOME=$PORTABLE_JAVA_HOME" >> "$GITHUB_ENV"
54+
echo "$PORTABLE_JAVA_HOME/bin" >> "$GITHUB_PATH"
55+
56+
# Pin Gradle toolchain to the active JDK (portable on Linux, setup-java on Windows)
57+
- name: Pin Gradle toolchain
58+
shell: bash
59+
run: |
60+
ACTIVE_JAVA_HOME="${PORTABLE_JAVA_HOME:-$JAVA_HOME}"
61+
echo "JAVA_HOME=${ACTIVE_JAVA_HOME}" >> "$GITHUB_ENV"
62+
echo "${ACTIVE_JAVA_HOME}/bin" >> "$GITHUB_PATH"
63+
echo "org.gradle.java.installations.paths=${ACTIVE_JAVA_HOME}" >> gradle.properties
64+
echo "org.gradle.java.installations.auto-detect=false" >> gradle.properties
65+
66+
- name: Show Java & jlink
67+
shell: bash
68+
run: |
69+
echo "JAVA_HOME=$JAVA_HOME"
70+
"$JAVA_HOME/bin/java" -version
71+
"$JAVA_HOME/bin/jlink" --version
72+
73+
- name: Validate Gradle wrapper
74+
uses: gradle/actions/wrapper-validation@v4
75+
76+
- name: Setup Gradle (cache)
77+
uses: gradle/actions/setup-gradle@v4
78+
79+
# ---- FAIL FAST: package first (so jlink issues show immediately) ----
80+
- name: Package slim runtime (fail fast)
81+
shell: bash
82+
run: ./gradlew checksumSlimCompilerDist --no-daemon --stacktrace
83+
84+
- name: Run tests
85+
shell: bash
86+
run: ./gradlew test --no-daemon --stacktrace
87+
88+
- name: Upload packaged artifact (per-OS)
89+
uses: actions/upload-artifact@v4
2390
with:
24-
path: ~/.gradle/caches
25-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
26-
restore-keys: ${{ runner.os }}-gradle
27-
- name: Build & Run Tests
28-
working-directory: ./de.peeeq.wurstscript
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
31-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32-
run: ./gradlew test --info
91+
name: wurst-compiler-${{ matrix.os }}
92+
path: |
93+
de.peeeq.wurstscript/build/releases/*.zip
94+
de.peeeq.wurstscript/build/releases/*.tar.gz
95+
de.peeeq.wurstscript/build/releases/*.sha256
96+
if-no-files-found: error
97+
retention-days: 7

.github/workflows/release.yml

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,65 @@
1-
name: Deploy Pipeline
1+
name: Release slim runtimes (jlink)
22

33
on:
44
push:
5-
branches:
6-
- master
5+
tags:
6+
- 'v*' # e.g. v1.8.1.0
77
workflow_dispatch:
88

99
jobs:
10-
deploy:
11-
name: Build WurstScript and Upload to GitHub Release
12-
runs-on: ubuntu-latest
10+
build:
11+
name: Build ${{ matrix.plat }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- os: windows-latest
17+
plat: win-x64
18+
- os: ubuntu-latest
19+
plat: linux-x64
20+
- os: macos-13
21+
plat: macos-x64
22+
- os: macos-14
23+
plat: macos-arm64
24+
25+
runs-on: ${{ matrix.os }}
26+
permissions:
27+
contents: write
28+
env:
29+
GRADLE_OPTS: -Dorg.gradle.daemon=false
30+
defaults:
31+
run:
32+
working-directory: de.peeeq.wurstscript
1333

1434
steps:
15-
- name: Checkout code
35+
- name: Checkout
1636
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0 # your version task uses git describe
1739

18-
- name: Set up JDK 17
40+
- name: Setup Temurin JDK 25
1941
uses: actions/setup-java@v4
2042
with:
21-
java-version: 17
2243
distribution: temurin
44+
java-version: '25'
2345

24-
- name: Grant Gradle permissions
25-
working-directory: ./de.peeeq.wurstscript
26-
run: chmod +x ./gradlew
46+
- name: Validate Gradle wrapper
47+
uses: gradle/actions/wrapper-validation@v4
2748

28-
- name: Build WurstScript zips
29-
working-directory: ./de.peeeq.wurstscript
30-
run: ./gradlew create_zips
49+
- name: Setup Gradle cache
50+
uses: gradle/actions/setup-gradle@v4
3151

32-
- name: Create or update nightly-master tag
33-
run: |
34-
git config user.name "github-actions[bot]"
35-
git config user.email "github-actions[bot]@users.noreply.github.com"
36-
git tag -f nightly-master
37-
git push -f origin nightly-master
52+
# Build fat jar + jdeps + jlink + package + checksum for this OS
53+
- name: Package slim runtime (per-OS)
54+
run: ./gradlew --no-daemon --stacktrace checksumSlimCompilerDist
3855

39-
- name: Create GitHub Release and upload zips
40-
uses: softprops/action-gh-release@v1
56+
- name: Upload to GitHub Release
57+
uses: softprops/action-gh-release@v2
4158
with:
42-
tag_name: nightly-master
43-
name: Nightly Build (master)
44-
body: "This release is automatically updated from the latest push to `master`."
45-
draft: false
46-
prerelease: true
59+
# Attaches the per-OS files produced on this runner
4760
files: |
48-
de.peeeq.wurstscript/build/distributions/wurstpack_complete.zip
49-
de.peeeq.wurstscript/build/distributions/wurstpack_compiler.zip
61+
de.peeeq.wurstscript/build/releases/wurst-compiler-*-*.zip
62+
de.peeeq.wurstscript/build/releases/wurst-compiler-*-*.tar.gz
63+
de.peeeq.wurstscript/build/releases/*.sha256
5064
env:
5165
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

de.peeeq.wurstscript/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ application {
3434
version = "1.8.1.0"
3535

3636
java {
37-
toolchain { languageVersion = JavaLanguageVersion.of(25) }
37+
toolchain {
38+
languageVersion = JavaLanguageVersion.of(25)
39+
}
3840
}
41+
3942
tasks.withType(JavaCompile).configureEach { options.release = 25 }
4043

4144
jacoco {

0 commit comments

Comments
 (0)