-
Notifications
You must be signed in to change notification settings - Fork 23
74 lines (62 loc) · 2.78 KB
/
release-mac-arm.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release Mac ARM
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Check version
run: |
TAG=${{ github.ref_name }}
PROPERTIES_PATH=gradle.properties
APP_VERSION=$(awk -F'=' '/^app.version/ {print $2}' $PROPERTIES_PATH)
if [ "$TAG" != "$APP_VERSION" ]; then
echo "Tag $TAG does not match app version $APP_VERSION"
exit 1
fi
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Prepare signing
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p ${{ secrets.BUILD_KEYCHAIN_PWD }} build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p ${{ secrets.BUILD_KEYCHAIN_PWD }} build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security find-identity -v
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${{ secrets.BUILD_KEYCHAIN_PWD }} build.keychain
echo $'compose.desktop.mac.sign=true\ncompose.desktop.mac.signing.identity=${{ secrets.MACOS_CERTIFICATE_IDENTITY }}\ncompose.desktop.mac.notarization.appleID=${{ secrets.APPLE_ID }}\ncompose.desktop.mac.notarization.password=${{ secrets.MACOS_APP_PWD }}\ncompose.desktop.mac.notarization.teamID=${{ secrets.APPLE_TEAM_ID }}' >local.properties
cat local.properties
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: notarizeDmg
- name: Rename
run: |
VERSION=${{ github.ref_name }}
echo $VERSION
PREFIX=$(echo $VERSION | cut -d'-' -f 1)
echo $PREFIX
mv ./build/compose/binaries/main/dmg/vLabeler-$PREFIX.dmg ./vlabeler-$VERSION-mac-arm64.dmg
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: vlabeler-${{ github.ref_name }}-mac-arm64.dmg