-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.96 KB
/
build.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
on:
repository_dispatch:
types: [ensure_build]
workflow_dispatch:
inputs:
otpVersion:
description: "OTP version (e.g. 26.1.2)"
required: true
type: string
jobs:
build:
name: Ensure that there is a jinterface published corresponding to input otpVersion
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
- name: done if already published
id: already_published_check
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTP_VERSION: ${{ inputs.otpVersion }}${{ toJSON(github.event) }}
run: |
echo OTP_VERSION: $OTP_VERSION
mvn dependency:get -Dartifact=com.mechanical-orchard:jinterface:$OTP_VERSION -DremoteRepositories=github::default::https://maven.pkg.github.com/mechanical-orchard/jinterface
- name: install dependencies
if: steps.already_published_check.outcome == 'failure'
run: sudo apt update && sudo apt install -y --no-install-recommends ncurses-dev dpkg-dev dpkg gcc g++ libc-dev make ca-certificates
- name: make OtpErlang.jar
if: steps.already_published_check.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTP_VERSION: ${{ inputs.otpVersion }}${{ toJSON(github.event) }}
run: |
curl -fSL -o otp-src.tar.gz "https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz"
export ERL_TOP=`pwd`/otp-OTP-${OTP_VERSION}
tar -xzf otp-src.tar.gz
cd $ERL_TOP
./configure
cd lib/jinterface
make
mvn deploy:deploy-file -DrepositoryId=github -Dfile=priv/OtpErlang.jar -Durl=https://maven.pkg.github.com/mechanical-orchard/jinterface -DgroupId=com.mechanical-orchard -DartifactId=jinterface -Dversion=$OTP_VERSION -Dpackaging=jar