Skip to content

Commit

Permalink
Merge pull request #1 from hoangmaihuy/github-workflows
Browse files Browse the repository at this point in the history
feat: Github workflow
  • Loading branch information
hoangmaihuy authored Dec 1, 2023
2 parents 8cde528 + 03ed4f0 commit 177a1ff
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
push:
branches:
- main
tags:
- '**'
pull_request:

# cancel older runs of a pull request;
# this will not cancel anything for normal git pushes
concurrency:
group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java-version: [8, 11]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: temurin

# Check publishing
- run: ./millw -i __.publishLocal $(pwd)/testRepo

# Test
- run: ./millw -i -k __.test

publish:
needs: [build]
if: github.repository == 'hoangmaihuy/mill-missinglink' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency: publish-{{ github.sha }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin

- run: ./millw -i __.publishLocal testRepo

- name: Setup GPG secrets
run: |
gpg --version
cat <(echo "${{ secrets.GPG_SECRET_KEY }}") | base64 --decode | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish to Maven Central
run: ./millw -i mill.scalalib.PublishModule/publishAll --sonatypeCreds "${{ secrets.SONATYPE_CREDS }}" --gpgArgs "--passphrase=${{ secrets.GPG_SECRET_KEY_PASS}},--batch,--yes,-a,-b,--pinentry-mode,loopback" --publishArtifacts __.publishArtifacts --readTimeout 600000 --awaitTimeout 600000 --release true --signed true

0 comments on commit 177a1ff

Please sign in to comment.