Skip to content

Commit 1f5817d

Browse files
committed
Use setup-java action for all in #1 thanks @Stefterv!
1 parent c7dc558 commit 1f5817d

File tree

1 file changed

+21
-61
lines changed

1 file changed

+21
-61
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,19 @@ jobs:
1212
run: yes | sudo apt-get update
1313
- name: Install rsync
1414
run: yes | sudo apt-get install rsync
15-
- name: Install wget
16-
run: yes | sudo apt-get install wget
17-
- name: Install ant
18-
run: >
19-
cd /tmp;
20-
wget https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.14-bin.zip;
21-
unzip apache-ant-1.10.14-bin.zip
22-
- name: Install java
23-
run: >
24-
cd /tmp;
25-
wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.5%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz;
26-
tar -xvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz;
27-
- name: Prepare env
28-
run: >
29-
cd /tmp;
30-
echo 'export ANT_HOME="/tmp/apache-ant-1.10.14"' >> .bash_profile;
31-
echo 'export PATH="$PATH:/tmp/apache-ant-1.10.14/bin"' >> .bash_profile;
32-
echo 'export JAVA_HOME="/tmp/jdk-17.0.5+8"' >> .bash_profile
33-
- name: Try build
15+
- name: Install Java
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
architecture: x64
21+
- name: Build
3422
run: >
35-
source /tmp/.bash_profile;
3623
cd build;
3724
ant clean;
3825
ant build
3926
- name: Test
4027
run: >
41-
source /tmp/.bash_profile;
4228
cd build;
4329
ant test
4430
linux:
@@ -52,27 +38,14 @@ jobs:
5238
run: yes | sudo apt-get update
5339
- name: Install rsync
5440
run: yes | sudo apt-get install rsync
55-
- name: Install wget
56-
run: yes | sudo apt-get install wget
57-
- name: Install ant
58-
run: >
59-
cd /tmp;
60-
wget https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.14-bin.zip;
61-
unzip apache-ant-1.10.14-bin.zip
62-
- name: Install java
63-
run: >
64-
cd /tmp;
65-
wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.5%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz;
66-
tar -xvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz;
67-
- name: Prepare env
68-
run: >
69-
cd /tmp;
70-
echo 'export ANT_HOME="/tmp/apache-ant-1.10.14"' >> .bash_profile;
71-
echo 'export PATH="$PATH:/tmp/apache-ant-1.10.14/bin"' >> .bash_profile;
72-
echo 'export JAVA_HOME="/tmp/jdk-17.0.5+8"' >> .bash_profile
41+
- name: Install Java
42+
uses: actions/setup-java@v4
43+
with:
44+
java-version: '17'
45+
distribution: 'temurin'
46+
architecture: x64
7347
- name: Build linux
7448
run: >
75-
source /tmp/.bash_profile;
7649
cd build;
7750
ant clean;
7851
ant build
@@ -93,27 +66,14 @@ jobs:
9366
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
9467
- name: Install rsync
9568
run: brew install rsync
96-
- name: Install wget
97-
run: brew install wget
98-
- name: Install ant
99-
run: >
100-
cd /tmp;
101-
wget https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.14-bin.zip;
102-
unzip apache-ant-1.10.14-bin.zip
103-
- name: Install java
104-
run: >
105-
cd /tmp;
106-
wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.5%2B8/OpenJDK17U-jdk_x64_mac_hotspot_17.0.5_8.tar.gz;
107-
tar -xvf OpenJDK17U-jdk_x64_mac_hotspot_17.0.5_8.tar.gz;
108-
- name: Prepare env
109-
run: >
110-
cd /tmp;
111-
echo 'export ANT_HOME="/tmp/apache-ant-1.10.14"' >> .bash_profile;
112-
echo 'export PATH="$PATH:/tmp/apache-ant-1.10.14/bin"' >> .bash_profile;
113-
echo 'export JAVA_HOME="/tmp/jdk-17.0.5+8/Contents/Home"' >> .bash_profile
69+
- name: Install Java
70+
uses: actions/setup-java@v4
71+
with:
72+
java-version: '17'
73+
distribution: 'temurin'
74+
architecture: x64
11475
- name: Build mac
11576
run: >
116-
source /tmp/.bash_profile;
11777
cd build;
11878
ant clean;
11979
ant build
@@ -130,11 +90,11 @@ jobs:
13090
steps:
13191
- name: Checkout
13292
uses: actions/checkout@v4
133-
- name: Set up JDK 11 for x64
93+
- name: Install Java
13494
uses: actions/setup-java@v4
13595
with:
13696
java-version: '17'
137-
distribution: 'temurin'
97+
distribution: 'temurin'
13898
architecture: x64
13999
- name: Build
140100
run: >

0 commit comments

Comments
 (0)