Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Mar 8, 2023
1 parent 4dae1d5 commit ecf4019
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 46 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-mqtt (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-mqtt (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
60 changes: 15 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,59 +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]
include:
- os: ubuntu-latest
jdk: 17
jdk_release: latest
- os: ubuntu-latest
jdk: 8
jdk_release: "jdk8u282-b08" # required due to https://bugs.openjdk.java.net/browse/JDK-8266279
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
release: ${{ matrix.jdk_release }}
- 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.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Vert.x MQTT

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

This project provides the following two different components :

Expand Down

0 comments on commit ecf4019

Please sign in to comment.