-
Notifications
You must be signed in to change notification settings - Fork 38
86 lines (73 loc) · 2.42 KB
/
build.yml
File metadata and controls
86 lines (73 loc) · 2.42 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
name: build opensource COBOL 4J
on:
workflow_call:
inputs:
os:
required: true
type: string
configure-args:
required: false
type: string
default: ""
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ inputs.os }}
steps:
- uses: actions/setup-java@v5
if: inputs.os == 'ubuntu:24.04'
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/setup-java@v5
if: inputs.os == 'almalinux:9'
with:
distribution: 'temurin'
java-version: '11'
- name: Install dependencies on Ubuntu 24.04
if: inputs.os == 'ubuntu:24.04'
run: |
apt-get update -y
apt-get install -y build-essential gettext autoconf bison flex
- name: Install dependencies on AlmaLinux 9
if: inputs.os == 'almalinux:9'
run: |
dnf -y update
dnf install -y gcc make autoconf diffutils gettext bison flex
- name: Install dependencies on Amazon Linux 2023
if: inputs.os == 'amazonlinux:2023'
run: |
dnf -y update
dnf install -y java-21-amazon-corretto-devel gcc make autoconf diffutils gettext tar gzip bison flex
- name: Checkout opensource COBOL 4J
uses: actions/checkout@v6
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
gradle-version: wrapper
- name: Install opensource COBOL 4J
if: inputs.configure-args == ''
run: |
./configure --prefix=/usr/ CFLAGS=-Werror
make
echo "ARTIFACT_NAME=${{ inputs.os }}" | sed 's/:/-/g' >> "$GITHUB_ENV"
- name: Install opensource COBOL 4J
if: inputs.configure-args != ''
run: |
./configure --prefix=/usr/ CFLAGS=-Werror ${{ inputs.configure-args }}
touch cobj/*.m4
make
echo "ARTIFACT_NAME=${{ inputs.os }}" | sed 's/:/-/g' >> "$GITHUB_ENV"
- name: Create an artifact file
run: |
cd ../
tar zcf opensourcecobol4j.tar.gz opensourcecobol4j
mv opensourcecobol4j.tar.gz opensourcecobol4j
- name: Upload an artifact
uses: actions/upload-artifact@v7
with:
name: opensourcecobol4j-${{ env.ARTIFACT_NAME }}-opt_${{ inputs.configure-args }}
path: opensourcecobol4j.tar.gz