Skip to content

Commit

Permalink
Use ASF shared GitHub actions
Browse files Browse the repository at this point in the history
- use shared actions
- fix build with empty local repository
  • Loading branch information
slawekjaranowski committed May 16, 2023
1 parent 012e059 commit d9f1d82
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 109 deletions.
94 changes: 3 additions & 91 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,8 @@
name: GitHub CI

on:
workflow_dispatch: {}
push:
branches:
- '*'
pull_request:
branches:
- 'main'
- 'master'
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Prepare maven build
shell: bash
# cannot go offline, the system dependency is being looked up on Central.
# blocked by MDEP-568
run: mvn --show-version --errors --batch-mode validate

- name: Build with Maven
shell: bash
run: mvn --show-version --errors --batch-mode "-Dinvoker.streamLogsOnFailures=true" clean verify

site:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
shell: bash
run: mvn --show-version --errors --batch-mode clean site site:stage

build-all:

needs: build

strategy:
matrix:
maven: [ '3.2.5', '3.3.9', '3.6.3', '3.8.4' ]
os: [ ubuntu-latest, windows-latest, macOS-latest ]
java:
# Hotspot VM, the "default" VM
- version: 8
dist: temurin
- version: 11
dist: temurin
- version: 17
dist: temurin
fail-fast: false

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

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java.version }}
distribution: ${{ matrix.java.dist }}
cache: 'maven'

- name: Set up Maven
shell: bash
run: mvn -N "io.takari:maven:0.7.7:wrapper" "-Dmaven=${{ matrix.maven }}"

- name: Prepare maven build
shell: bash
run: ./mvnw --show-version --errors --batch-mode validate

- name: Build with Maven
shell: bash
run: ./mvnw --show-version --errors --batch-mode "-Dinvoker.streamLogsOnFailures=true" clean verify javadoc:javadoc
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
This is the [properties-maven-plugin](http://www.mojohaus.org/properties-maven-plugin/).

[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.mojo/properties-maven-plugin.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.mojo/properties-maven-plugin)
[![Build Status](https://travis-ci.org/mojohaus/properties-maven-plugin.svg?branch=master)](https://travis-ci.org/mojohaus/properties-maven-plugin)

[![GitHub CI](https://github.com/mojohaus/properties-maven-plugin/actions/workflows/maven.yml/badge.svg)](https://github.com/mojohaus/properties-maven-plugin/actions/workflows/maven.yml)
## Releasing

* Make sure `gpg-agent` is running.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<scm>
<connection>scm:git:https://github.com/mojohaus/properties-maven-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/mojohaus/properties-maven-plugin.git</developerConnection>
<url>https://github.com/mojohaus/properties-maven-plugin/tree/${scm.tag}</url>
<url>https://github.com/mojohaus/properties-maven-plugin/tree/master</url>
<tag>master</tag>
</scm>
<issueManagement>
Expand Down
16 changes: 4 additions & 12 deletions src/it/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,9 @@ under the License.
-->

<settings>
<mirrors>
<mirror>
<id>it-repo</id>
<name>RPM</name>
<url>@localRepositoryUrl@</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
Expand All @@ -60,4 +49,7 @@ under the License.
</pluginRepositories>
</profile>
</profiles>
</settings>
<activeProfiles>
<activeProfile>it-repo</activeProfile>
</activeProfiles>
</settings>
6 changes: 3 additions & 3 deletions src/it/write-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<version>0.0.1-SNAPSHOT</version>

<properties>
<g>${groupId}</g>
<a>${artifactId}</a>
<v>${version}</v>
<g>${project.groupId}</g>
<a>${project.artifactId}</a>
<v>${project.version}</v>
<properties-maven-plugin.version>@project.version@</properties-maven-plugin.version>
</properties>

Expand Down

0 comments on commit d9f1d82

Please sign in to comment.