-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (88 loc) · 3.58 KB
/
release.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
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
102
# note: list of awesome GitHub Actions: https://github.com/sdras/awesome-actions
name: Release pagina EPUB-Checker Apps
on:
push:
branches:
## live
- main
## debug
# - development
jobs:
release:
runs-on: macos-latest
env:
MAVEN_VERSIONS_PLUGIN: org.codehaus.mojo:versions-maven-plugin:2.7
steps:
- uses: actions/checkout@v2
with:
lfs: false
fetch-depth: '0'
## live
ref: 'main'
## debug
# ref: 'development'
# - name: Checkout LFS objects
# run: git lfs checkout
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
# The certificates in a PKCS12 file encoded as a base64 string created with "openssl base64 -in cert.p12 -out cert-base64.txt"
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
# The password used to import the PKCS12 file.
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- name: Install gon via HomeBrew for code signing and app notarization
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: Create gon config file
run: |
echo ${{ secrets.GON_DMG_CONFIG_BASE64 }} | base64 --decode > src/build/gon-dmg-config.json
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: '8'
- name: Set up GitHub Actions git user
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Cache Maven dependencies between builds
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build the Java App and the native wrappers with Maven and codesign and notarize the Mac App
run: |
mvn -B ${MAVEN_VERSIONS_PLUGIN}:set -DremoveSnapshot=true -DgenerateBackupPoms=false
export MAVEN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout)
mvn -B --show-version -Dmaven.skip.macSigning=false clean package
git commit -a -m "release version ${MAVEN_PROJECT_VERSION}"
git tag v${MAVEN_PROJECT_VERSION}
- name: Push changes at pom.xml to main
# 'github-push-action' does not work on 'macos-latest': https://github.com/ad-m/github-push-action/issues/51
#uses: ad-m/[email protected]
#with:
# tags: true
# github_token: ${{ secrets.GITHUB_TOKEN }}
run: |
git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main --follow-tags --tags
- name: Increment maven project version on development branch
run: |
git fetch --prune
git checkout -f development
git merge --no-ff main
mvn -B ${MAVEN_VERSIONS_PLUGIN}:set -DnextSnapshot=true -DgenerateBackupPoms=false
git commit -a -m "prepare for next development iteration"
git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:development
- name: Archive build distributables
uses: actions/upload-artifact@v2
with:
name: Signed-Apps
path: |
target/EPUB-Checker.dmg
target/EPUB-Checker-*-dist-mac.zip
target/EPUB-Checker-*-dist-win.zip
target/EPUB-Checker-*-dist-linux.tar.gz
# TODO: Upload release-files to our primary download server
# https://github.com/marketplace/actions/scp-files