Release #101
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: Release | |
on: | |
workflow_run: | |
workflows: ["Build and Test"] | |
branches: [ master ] | |
types: [ completed ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Coursier | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier | |
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/build.sbt') }} | |
- name: Cache Sbt | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Setup Dhall | |
uses: dhall-lang/setup-dhall@v4 | |
- name: publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GPG_SEC: ${{ secrets.GPG_SEC }} | |
GPG_PUB: ${{ secrets.GPG_PUB }} | |
PGP_PASS: ${{ secrets.PGP_PASS }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | |
run: | | |
LAST_RELEASE=$(hub release -L 1) | |
LOCAL_VERSION=$(dhall text <<< 'let a = ./build.dhall in "v${a.version}.${env:GITHUB_RUN_NUMBER as Text}"') | |
echo "main version is $LAST_RELEASE and current version is $LOCAL_VERSION" | |
if [ $LAST_RELEASE != $LOCAL_VERSION ];then | |
mkdir -p .gnupg | |
echo $GPG_SEC | base64 --decode > .gnupg/secring.asc | |
echo $GPG_PUB | base64 --decode > .gnupg/pubring.asc | |
sbt +releaseEarly | |
hub release create -m "${LOCAL_VERSION}" "${LOCAL_VERSION}" | |
fi |