jdk
109 строк · 4.1 Кб
1#
2# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26name: 'Get bundles'
27description: 'Download resulting JDK bundles'
28inputs:
29platform:
30description: 'Platform name'
31required: true
32debug-suffix:
33description: 'File name suffix denoting debug level, possibly empty'
34required: false
35outputs:
36jdk-path:
37description: 'Path to the installed JDK bundle'
38value: ${{ steps.path-name.outputs.jdk }}
39symbols-path:
40description: 'Path to the installed symbols bundle'
41value: ${{ steps.path-name.outputs.symbols }}
42tests-path:
43description: 'Path to the installed tests bundle'
44value: ${{ steps.path-name.outputs.tests }}
45
46runs:
47using: composite
48steps:
49- name: 'Download bundles artifact'
50id: download-bundles
51uses: actions/download-artifact@v4
52with:
53name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
54path: bundles
55continue-on-error: true
56
57- name: 'Download bundles artifact (retry)'
58uses: actions/download-artifact@v4
59with:
60name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
61path: bundles
62if: steps.download-bundles.outcome == 'failure'
63
64- name: 'Unpack bundles'
65run: |
66if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip ]]; then
67echo 'Unpacking jdk bundle...'
68mkdir -p bundles/jdk
69unzip -q bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip -d bundles/jdk
70fi
71
72if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then
73echo 'Unpacking jdk bundle...'
74mkdir -p bundles/jdk
75tar -xf bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/jdk
76fi
77
78if [[ -e bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then
79echo 'Unpacking symbols bundle...'
80mkdir -p bundles/symbols
81tar -xf bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/symbols
82fi
83
84if [[ -e bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then
85echo 'Unpacking tests bundle...'
86mkdir -p bundles/tests
87tar -xf bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/tests
88fi
89shell: bash
90
91- name: 'Export paths to where bundles are installed'
92id: path-name
93run: |
94# Export the paths
95
96jdk_dir="$GITHUB_WORKSPACE/$(dirname $(find bundles/jdk -name bin -type d))"
97symbols_dir="$GITHUB_WORKSPACE/$(dirname $(find bundles/symbols -name bin -type d))"
98tests_dir="$GITHUB_WORKSPACE/bundles/tests"
99
100if [[ '${{ runner.os }}' == 'Windows' ]]; then
101jdk_dir="$(cygpath $jdk_dir)"
102symbols_dir="$(cygpath $symbols_dir)"
103tests_dir="$(cygpath $tests_dir)"
104fi
105
106echo "jdk=$jdk_dir" >> $GITHUB_OUTPUT
107echo "symbols=$symbols_dir" >> $GITHUB_OUTPUT
108echo "tests=$tests_dir" >> $GITHUB_OUTPUT
109shell: bash
110