Skip to content

.github/workflows/build.yml #1

.github/workflows/build.yml

.github/workflows/build.yml #1

Workflow file for this run

on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
java-version: [8, 11, 17]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- run: ./millw --no-server "__.publishM2Local" test-repo
publish-sonatype:
# TODO: also publish release-branches
if: github.repository == 'com-lihaoyi/mill-moduledefs' && startsWith( github.ref, 'refs/tags/')
needs: [test]
runs-on: ubuntu-latest
env:
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- name: Setup GPG secrets for publish
run: |
gpg --version
cat <(echo "${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}") | base64 --decode | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish to Maven Central
run: ./millw --no-server --debug publishToSonatype --sonatypeCreds "${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }}" --gpgArgs "--passphrase=${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD}},--batch,--yes,-a,-b,--pinentry-mode,loopback" --artifactsFile PUBLISH_ONLY