-
-
Notifications
You must be signed in to change notification settings - Fork 77
64 lines (55 loc) · 2.14 KB
/
pkgbuild.yml
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
name: macOS
on:
workflow_dispatch:
pull_request:
branches: [ master ]
paths:
- 'pkgbuild/**'
- '.github/workflows/pkgbuild.yml'
permissions:
contents: read
jobs:
pkgbuild:
strategy:
fail-fast: false
matrix:
jdk: [8, 11, 17, 21]
architecture: [x64, aarch64]
exclude:
- jdk: 8
architecture: aarch64
name: pkgbuild
runs-on: macos-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install dependencies
run: brew install --cask packages
- name: Fetch latest macOS version from Adoptium API
run: |
response=$(curl -s "https://api.adoptium.net/v3/assets/feature_releases/${{ matrix.jdk }}/ga?architecture=${{ matrix.architecture }}&image_type=jdk&os=mac&page=0&page_size=1")
json=$(echo "$response" | jq '.[0]')
major=$(echo "$json" | jq -r '.version_data.major')
echo "MAJOR_VERSION=$major" >> $GITHUB_ENV
echo "TAG=$(echo "$json" | jq -r '.release_name')" >> $GITHUB_ENV
# SUB_TAG is used to create the file name of the JDK/JRE zip file
release_name=$(echo "$json" | jq -r '.release_name')
if [[ "$major" -eq 8 ]]; then
subTag=$(echo "$release_name" | sed -e 's/jdk//' -e 's/-//')
else
subTag=$(echo "$release_name" | sed -e 's/jdk-//' -e 's/+/_/')
fi
echo "FULL_VERSION=$subTag" >> $GITHUB_ENV
echo "SUB_TAG=$subTag" >> $GITHUB_ENV
- name: Download prebuilt binaries
run: |
mkdir -p workspace/target/
cd workspace/target/
wget -q "https://github.com/adoptium/temurin${{ env.MAJOR_VERSION }}-binaries/releases/download/${{ env.TAG }}/OpenJDK${{ env.MAJOR_VERSION }}U-jdk_${{ matrix.architecture }}_mac_hotspot_${{ env.SUB_TAG }}.tar.gz"
- name: Create Package
run: |
export WORKSPACE=$PWD
bash pkgbuild/create-installer-mac.sh
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: macos-${{ env.MAJOR_VERSION }}-${{ matrix.architecture }}
path: workspace/target/*.pkg