-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (113 loc) · 3.94 KB
/
Copy pathrelease.yml
File metadata and controls
135 lines (113 loc) · 3.94 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
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
name: Publish Release (Java build + GraalVM natives from ./install)
permissions:
contents: write
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
name: Build Java + Publish GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compute tag + version
id: meta
shell: bash
run: |
set -euo pipefail
TAG="${GITHUB_REF##*/}"
VERSION="${TAG#v}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Show resolved tag + version
shell: bash
run: |
echo "Tag: ${{ steps.meta.outputs.tag }}"
echo "Version: ${{ steps.meta.outputs.version }}"
- name: Set up Java 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "8"
- name: Make Gradle wrapper executable
shell: bash
run: chmod +x ./gradlew
- name: Build JARs + JVM distributions
shell: bash
run: |
set -euo pipefail
./gradlew clean test jar fatjar distTar distZip sourcesJar javadocJar --no-daemon --stacktrace
echo "== Build outputs =="
ls -la openccjava/build/libs || true
ls -la openccjavacli/build/libs || true
ls -la openccjavacli/build/distributions || true
- name: Collect Java artifacts
shell: bash
run: |
set -euo pipefail
VERSION="${{ steps.meta.outputs.version }}"
mkdir -p release_artifacts/java/openccjava
mkdir -p release_artifacts/java/openccjavacli
# Library jars
cp openccjava/build/libs/*"$VERSION"*.jar release_artifacts/java/openccjava/
# CLI jars (including fat jar)
cp openccjavacli/build/libs/*"$VERSION"*.jar release_artifacts/java/openccjavacli/
# JVM distributions → rename to *.jvm.*
for f in openccjavacli/build/distributions/*"$VERSION"*; do
base="$(basename "$f")"
case "$base" in
*.zip) new="${base%.zip}.jvm.zip" ;;
*.tar) new="${base%.tar}.jvm.tar" ;;
*.tar.gz) new="${base%.tar.gz}.jvm.tar.gz" ;;
*.tgz) new="${base%.tgz}.jvm.tgz" ;;
*) new="$base" ;;
esac
cp "$f" "release_artifacts/java/openccjavacli/$new"
done
echo "== Java staged files =="
find release_artifacts/java -type f
- name: Verify install/ directory exists
shell: bash
run: |
set -euo pipefail
if [ ! -d install ]; then
echo "::error::install/ directory not found."
exit 1
fi
echo "Files currently in ./install:"
ls -la install || true
- name: Collect GraalVM native artifacts
shell: bash
run: |
set -euo pipefail
VERSION="${{ steps.meta.outputs.version }}"
# STRICT MATCH: *-VERSION-*
shopt -s nullglob
files=(install/*-"$VERSION"-*)
if [ ${#files[@]} -eq 0 ]; then
echo "::error::No GraalVM natives in ./install match version '$VERSION'."
exit 1
fi
mkdir -p release_artifacts/native
for f in "${files[@]}"; do
echo " + $f"
cp "$f" release_artifacts/native/
done
echo "== Native staged files =="
find release_artifacts/native -type f
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: ${{ steps.meta.outputs.tag }}
draft: false
prerelease: ${{ contains(steps.meta.outputs.tag, '-') }}
files: |
release_artifacts/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}