Skip to content

Commit 53ffd5c

Browse files
committed
Merge remote-tracking branch 'origin' into mac-build
2 parents 196c18d + d450b5e commit 53ffd5c

File tree

2 files changed

+73
-7
lines changed

2 files changed

+73
-7
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
- '**'
1111

1212
jobs:
13-
build:
14-
name: Migtool build
13+
build-linux:
14+
name: Migtool build for linux-x86
1515
if: "!contains(github.event.head_commit.message, '[ci skip]')"
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 90
@@ -23,7 +23,7 @@ jobs:
2323
run: env | sort
2424

2525
- name: Checkout
26-
uses: actions/checkout@v1
26+
uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 1
2929

@@ -52,7 +52,7 @@ jobs:
5252
- name: Upload linux native image artifact
5353
uses: actions/upload-artifact@v4
5454
with:
55-
name: migtool-linux
55+
name: migtool-linux-x86
5656
path: build/native/nativeCompile/migtool
5757
overwrite: true
5858

@@ -69,10 +69,73 @@ jobs:
6969
path: build/reports/tests/nativeCliTest/
7070
overwrite: true
7171

72+
build-macos:
73+
name: Migtool build for MacOS-arm64
74+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
75+
runs-on: macos-latest
76+
timeout-minutes: 90
77+
strategy:
78+
fail-fast: false
79+
80+
steps:
81+
- name: Environment
82+
run: env | sort
83+
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 1
88+
89+
- name: Setup Graalvm
90+
uses: graalvm/setup-graalvm@v1
91+
with:
92+
java-version: '21'
93+
distribution: 'graalvm'
94+
github-token: ${{ secrets.GITHUB_TOKEN }}
95+
native-image-job-reports: 'true'
96+
97+
- name: Build Native Image
98+
run: ./gradlew nativeCompile
99+
100+
- name: Codesign binary
101+
if: contains(github.event.head_commit.message, '[release]') && github.event.ref == 'refs/heads/master'
102+
env:
103+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
104+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
105+
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
106+
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }}
107+
run: |
108+
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
109+
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
110+
security default-keychain -s build.keychain
111+
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
112+
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
113+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
114+
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime build/native/nativeCompile/migtool -v
115+
116+
- name: Notarize binary
117+
if: contains(github.event.head_commit.message, '[release]') && github.event.ref == 'refs/heads/master'
118+
env:
119+
MACOS_AC_API_CERT: ${{ secrets.MACOS_AC_API_CERT }}
120+
MACOS_AC_API_ISSUER_ID: ${{ secrets.MACOS_AC_API_ISSUER_ID }}
121+
MACOS_AC_API_KEY_ID: ${{ secrets.MACOS_AC_API_KEY_ID }}
122+
run: |
123+
echo $MACOS_AC_API_CERT | base64 --decode > AuthKey.p8
124+
xcrun notarytool store-credentials "notarytool-profile" -k AuthKey.p8 -d "$MACOS_AC_API_KEY_ID" -i "$MACOS_AC_API_ISSUER_ID"
125+
ditto -c -k --keepParent "build/native/nativeCompile/migtool" "notarization.zip"
126+
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
127+
128+
- name: Upload MacOS native image artifact
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: migtool-macos-arm64
132+
path: build/native/nativeCompile/migtool
133+
overwrite: true
134+
72135
release:
73136
name: Release
74137
if: "contains(github.event.head_commit.message, '[release]') && github.event.ref=='refs/heads/master'"
75-
needs: [ build ]
138+
needs: [ build-linux, build-macos ]
76139
runs-on: ubuntu-latest
77140
steps:
78141
- name: Checkout repository
@@ -94,7 +157,7 @@ jobs:
94157
run: |
95158
VERSION=$(cat ./VERSION)
96159
echo "VERSION = $VERSION"
97-
echo "::set-output name=VERSION::$VERSION"
160+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
98161
99162
- name: Run JReleaser
100163
uses: jreleaser/release-action@v2

jreleaser.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ distributions:
7676
migtool:
7777
type: NATIVE_IMAGE
7878
artifacts:
79-
- path: "migtool-linux/migtool"
79+
- path: "migtool-linux-x86/migtool"
8080
transform: "{{distributionName}}-linux-x86_64"
8181
platform: linux-x86_64
82+
- path: "migtool-macos-arm64/migtool"
83+
transform: "{{distributionName}}-macos-arm64"
84+
platform: osx-aarch_64

0 commit comments

Comments
 (0)