Skip to content

Commit

Permalink
Update CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Mar 8, 2023
1 parent fe29284 commit 5bc653c
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 38 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci-4.x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: vertx-mail-client (4.x)
on:
schedule:
- cron: '0 4 * * *'
jobs:
CI:
strategy:
matrix:
include:
- os: ubuntu-latest
jdk: 8
- os: ubuntu-latest
jdk: 17
uses: ./.github/workflows/ci.yml
with:
branch: 4.x
jdk: ${{ matrix.jdk }}
os: ${{ matrix.os }}
secrets: inherit
Deploy:
if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }}
needs: CI
uses: ./.github/workflows/deploy.yml
with:
branch: 4.x
jdk: 8
secrets: inherit
33 changes: 33 additions & 0 deletions .github/workflows/ci-5.x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: vertx-mail-client (5.x)
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 5 * * *'
jobs:
CI:
strategy:
matrix:
include:
- os: ubuntu-latest
jdk: 8
- os: ubuntu-latest
jdk: 17
uses: ./.github/workflows/ci.yml
with:
branch: ${{ github.head_ref || github.ref_name }}
jdk: ${{ matrix.jdk }}
os: ${{ matrix.os }}
secrets: inherit
Deploy:
if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }}
needs: CI
uses: ./.github/workflows/deploy.yml
with:
branch: ${{ github.head_ref || github.ref_name }}
jdk: 8
secrets: inherit
52 changes: 15 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,29 @@
name: CI
on:
push:
branches:
- master
- '[0-9]+.[0-9]+'
pull_request:
branches:
- master
- '[0-9]+.[0-9]+'
schedule:
- cron: '0 4 * * *'
workflow_call:
inputs:
branch:
required: true
type: string
jdk:
default: 8
type: string
os:
default: ubuntu-latest
type: string
jobs:
Test:
name: Run tests
strategy:
matrix:
os: [ubuntu-latest]
jdk: [8, 17]
runs-on: ${{ matrix.os }}
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
- name: Install JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jdk }}
java-version: ${{ inputs.jdk }}
distribution: temurin
- name: Run tests
run: mvn -s .github/maven-ci-settings.xml -q clean verify -B
Deploy:
name: Deploy to OSSRH
if: ${{ github.repository_owner == 'vert-x3' && (github.event_name == 'push' || github.event_name == 'schedule') }}
needs: Test
runs-on: ubuntu-latest
env:
VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }}
VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v2
with:
java-version: 8
distribution: temurin
- name: Get project version
run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV
- name: Maven deploy
if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy
on:
workflow_call:
inputs:
branch:
required: true
type: string
jdk:
default: 8
type: string
jobs:
Deploy:
name: Deploy to OSSRH
runs-on: ubuntu-latest
env:
VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }}
VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
- name: Install JDK
uses: actions/setup-java@v2
with:
java-version: ${{ inputs.jdk }}
distribution: temurin
- name: Get project version
run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV
- name: Maven deploy
if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
== Vert.x mail (SMTP client)

image:https://github.com/vert-x3/vertx-mail-client/workflows/CI/badge.svg?branch=master["Build Status", link="https://github.com/vert-x3/vertx-mail-client/actions?query=workflow%3ACI"]
image:https://github.com/vert-x3/vertx-mail-client/actions/workflows/ci-5.x.yml/badge.svg["Build Status (5.x)",link="https://github.com/vert-x3/vertx-mail-client/actions/workflows/ci-5.x.yml"]
image:https://github.com/vert-x3/vertx-mail-client/actions/workflows/ci-4.x.yml/badge.svg["Build Status (4.x)",link="https://github.com/vert-x3/vertx-mail-client/actions/workflows/ci-4.x.yml"]

A simple asynchronous SMTP client for Vert.x

Expand Down

0 comments on commit 5bc653c

Please sign in to comment.