Skip to content

README changes by @br-pagina #44

README changes by @br-pagina

README changes by @br-pagina #44

Workflow file for this run

# note: list of awesome GitHub Actions: https://github.com/sdras/awesome-actions
name: Release pagina EPUB-Checker Apps
on:
push:
branches:
## live
- master
## 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: true
fetch-depth: '0'
## live
ref: 'master'
## 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: Rename license file
# run: |
# find . -name "LICENSE" -exec bash -c 'echo mv $0 ${0/LICENSE/LICENSE.txt}' {} \;
# find /tmp -name "LICENSE" -exec bash -c 'echo mv $0 ${0/LICENSE/LICENSE.txt}' {} \;
- 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 clean compile
find . -name "LICENSE" -exec bash -c 'echo mv $0 ${0/LICENSE/LICENSE.txt}' {} \;
find /tmp -name "LICENSE" -exec bash -c 'echo mv $0 ${0/LICENSE/LICENSE.txt}' {} \;
find /Users/runner/work/EPUB-Checker/ -name "LICENSE" -exec bash -c 'echo mv $0 ${0/LICENSE/LICENSE.txt}' {} \;
mvn -B --show-version -Dmaven.skip.macSigning=false package -Dmaven.compile.skip=true -DSkipTests
git commit -a -m "release version ${MAVEN_PROJECT_VERSION}"
git tag v${MAVEN_PROJECT_VERSION}
- name: Push changes at pom.xml to master
# '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:master --follow-tags --tags
- name: Increment maven project version on development branch
run: |
git fetch --prune
git checkout -f development
git merge --no-ff master
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