build: Update GH actions #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: EarlyAccess | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
precheck: | |
name: Precheck | |
if: startsWith(github.event.head_commit.message, 'Releasing version') != true | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.vars.outputs.VERSION }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: n1hility/cancel-previous-runs@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Version | |
id: vars | |
shell: bash | |
run: | | |
echo ::set-output name=VERSION::$(cat VERSION) | |
build: | |
name: Build | |
needs: [precheck] | |
if: endsWith(${{ needs.precheck.outputs.VERSION }}, '-SNAPSHOT') | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ vars.JAVA_VERSION }} | |
distribution: ${{ vars.JAVA_DISTRO }} | |
cache: gradle | |
- name: Build | |
run: ./gradlew -Prelease=true build | |
- name: Assemble | |
run: ./gradlew -Prelease=true :ikonli-browser:jlinkZip :ikonli-browser:jpackage | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
if-no-files-found: ignore | |
retention-days: 1 | |
path: | | |
apps/ikonli-browser/build/distributions/ikonli-browser-*x86_64.zip | |
apps/ikonli-browser/build/packagers/ikonli-browser-*.rpm | |
apps/ikonli-browser/build/packagers/ikonli-browser-*.dmg | |
apps/ikonli-browser/build/packagers/ikonli-browser-*.exe | |
apps/ikonli-browser/build/packagers/ikonli-browser-*.msi | |
apps/ikonli-browser/build/packagers/ikonli-browser-*.pkg | |
apps/ikonli-browser/build/packagers/ikonli-browser-*.deb | |
release: | |
name: Release | |
needs: [precheck, build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
- name: Release | |
uses: jreleaser/release-action@v2 | |
with: | |
version: early-access | |
arguments: full-release -P artifactsDir=artifacts | |
env: | |
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
- name: JReleaser output | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jreleaser-release | |
path: | | |
out/jreleaser/trace.log | |
out/jreleaser/output.properties |