use main env #6
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: CI | |
on: | |
create: | |
tags: | |
- '*' | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Java 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11.0.x | |
- name: Style checks | |
run: ./mill __.checkFormat + __.docJar | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Java 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11.0.x | |
- name: Run tests | |
run: ./mill __.test | |
publish: | |
needs: [checks, tests] | |
runs-on: ubuntu-latest | |
environment: main | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- run: ./mill -i io.kipp.mill.ci.release.ReleaseModule/publishAll | |
env: | |
PGP_PASSPHRASE: ${{ secrets.GPG_PASSWORD }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET_KEY }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_CREDENTIALS }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v2 | |
# - name: Pull all history with tags for correct versionning | |
# run: git fetch --prune --unshallow | |
# - name: Setup Java 11 | |
# uses: actions/setup-java@v1 | |
# with: | |
# java-version: 11.0.x | |
# - uses: jodersky/setup-mill@master | |
# with: | |
# mill-version: 0.11.7 | |
# - name: Publish | |
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' | |
# env: | |
# SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
# SONATYPE_CREDENTIALS: ${{ secrets.SONATYPE_CREDENTIALS }} | |
# GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
# run: | | |
# echo "${{ secrets.PGP_SECRET_KEY }}" | base64 --decode > private.key | |
# gpg --batch --yes --no-tty --import private.key | |
# rm private.key | |
# export GPG_TTY=$(tty) | |
# mill mill.scalalib.PublishModule/publishAll __.publishArtifacts $SONATYPE_USERNAME:$SONATYPE_CREDENTIALS --gpgArgs --passphrase=$GPG_PASSWORD |