Skip to content

Merge pull request #109 from lucidsoftware/gh-replaces-hub #100

Merge pull request #109 from lucidsoftware/gh-replaces-hub

Merge pull request #109 from lucidsoftware/gh-replaces-hub #100

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
tags:
- "*.*.*"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Startup MySQL service
run: sudo /etc/init.d/mysql start
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Env
if: ${{ github.repository == 'lucidsoftware/piezo' }}
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
version="${GITHUB_REF#refs/tags/}"
else
version="${GITHUB_REF##*/}-SNAPSHOT"
fi
echo "VERSION=$version" >> $GITHUB_ENV
echo "SBT_OPTS=-Dbuild.version=$version" >> $GITHUB_ENV
- name: Test
run: sbt compile test doc Debian/packageBin
- name: Publish to Sonatype
if: ${{ github.repository == 'lucidsoftware/piezo' && github.event_name != 'pull_request' }}
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
echo "$PGP_SECRET" | base64 --decode | gpg --import
if [[ $GITHUB_REF == refs/tags/* ]]; then
sbt '; publishSigned; sonatypeBundleRelease'
else
sbt publishSigned
fi
# TODO: publish deb somewhere?
- name: Upload assets to Github
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
sbt Universal/packageBin
gh release create -t "Release $VERSION" --generate-notes $VERSION {admin,worker}/target/**/*.jar admin/target/*.deb admin/target/universal/piezo-admin*.zip