forked from tofi86/universalJavaApplicationStub
-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (90 loc) · 3.65 KB
/
compile.yml
File metadata and controls
101 lines (90 loc) · 3.65 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Compile and release
# trigger the workflow manually
on: workflow_dispatch
jobs:
draft_release:
name: Create draft release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
release_version: ${{ steps.tag_name.outputs.release_version }}
steps:
- name: Get version from tag
id: tag_name
run: echo "release_version=$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v2
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release create --draft "${{ steps.tag_name.outputs.release_version }}" --generate-notes
- name: Upload universalJavaApplicationStub.sh asset
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
cp ./src/universalJavaApplicationStub ./universalJavaApplicationStub.sh
gh release upload "${{ steps.tag_name.outputs.release_version }}" ./universalJavaApplicationStub.sh
compile:
name: Compile the stub
needs: draft_release # we need to know the upload URL
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Install shc via HomeBrew
run: |
brew install shc
shc -h
- name: Compile universalJavaApplicationStub
run: |
echo "Running shc..."
shc -r -f src/universalJavaApplicationStub
- name: Build universalJavaApplicationStub x86_64
run: |
echo "Running clang for universalJavaApplicationStub.x86_64"
clang -o universalJavaApplicationStub.x86_64 -target x86_64-apple-macos10.10 src/universalJavaApplicationStub.x.c
strip universalJavaApplicationStub.x86_64
- name: Build universalJavaApplicationStub arm64
run: |
echo "Running clang for universalJavaApplicationStub.arm64"
clang -o universalJavaApplicationStub.arm64 -target arm64-apple-macos11 src/universalJavaApplicationStub.x.c
strip universalJavaApplicationStub.arm64
- name: Build universal universalJavaApplicationStub
run: |
echo "Runnning lipo"
lipo -create -output universalJavaApplicationStub universalJavaApplicationStub.x86_64 universalJavaApplicationStub.arm64
strip universalJavaApplicationStub
chmod ug=rwx,o=rx universalJavaApplicationStub
- name: Build nativeJavaApplicationStub
run: |
make universal
- name: Upload compiled assets
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
cp build/x86_64/nativeJavaApplicationStub ./nativeJavaApplicationStub.x86_64
cp build/arm64/nativeJavaApplicationStub ./nativeJavaApplicationStub.arm64
cp build/universal/nativeJavaApplicationStub ./nativeJavaApplicationStub
gh release upload "${{ needs.draft_release.outputs.release_version }}" \
./universalJavaApplicationStub.x86_64 \
./universalJavaApplicationStub.arm64 \
./universalJavaApplicationStub \
./nativeJavaApplicationStub.x86_64 \
./nativeJavaApplicationStub.arm64 \
./nativeJavaApplicationStub
publish_release:
name: Publish drafted release
needs: [ draft_release, compile ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Publish Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release edit "${{ needs.draft_release.outputs.release_version }}" --draft=false