Skip to content

Commit 6f6fb5c

Browse files
committed
add build as a workflow dispatch
1 parent ef1a115 commit 6f6fb5c

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/build.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
otpVersion:
5+
description: "OTP version (e.g. 26.1.2)"
6+
required: true
7+
type: string
8+
9+
jobs:
10+
build:
11+
name: Ensure that there is a jinterface published corresponding to input otpVersion
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- uses: actions/setup-java@v4
18+
with:
19+
java-version: "21"
20+
distribution: "temurin"
21+
22+
- name: done if already published
23+
id: already_published_check
24+
continue-on-error: true
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
OTP_VERSION: ${{ inputs.otpVersion }}
28+
run: |
29+
echo OTP_VERSION: $OTP_VERSION
30+
mvn dependency:get -Dartifact=com.mechanical-orchard:jinterface:$OTP_VERSION -DremoteRepositories=github::default::https://maven.pkg.github.com/mechanical-orchard/jinterface
31+
32+
- name: install dependencies
33+
if: steps.already_published_check.outcome == 'failure'
34+
run: sudo apt update && sudo apt install -y --no-install-recommends ncurses-dev dpkg-dev dpkg gcc g++ libc-dev make ca-certificates
35+
36+
- name: make OtpErlang.jar
37+
if: steps.already_published_check.outcome == 'failure'
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
OTP_VERSION: ${{ inputs.otpVersion }}
41+
run: |
42+
curl -fSL -o otp-src.tar.gz "https://github.com/erlang/otp/archive/OTP-$OTP_VERSION.tar.gz"
43+
export ERL_TOP=`pwd`/otp-OTP-${OTP_VERSION}
44+
tar -xzf otp-src.tar.gz
45+
cd $ERL_TOP
46+
./configure
47+
cd lib/jinterface
48+
make
49+
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

0 commit comments

Comments
 (0)