Skip to content

Commit

Permalink
Fixed #114 - Replacing .travis with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
khmarbaise committed Jun 1, 2020
1 parent 3798c4e commit 9fe14ae
Show file tree
Hide file tree
Showing 8 changed files with 254 additions and 36 deletions.
13 changes: 13 additions & 0 deletions .github/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sections:
- title: "Bug Fixes"
emoji: "🐞"
labels: ["bug"]
- title: "Enhancements"
emoji: ""
labels: ["enhancement"]
- title: "Dependency Upgrades"
emoji: "🔨"
labels: ["dependency-upgrade"]
- title: "Documentation"
emoji: "📔"
labels: ["documentation"]
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: SitePublishing

on:
push:
branches:
- master

jobs:
update-site:
name: Linux
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-ubuntu-latest-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-ubuntu-latest
- name: 'Setup Java Version'
uses: actions/setup-java@v1
with:
java-version: 11
- name: 'Build'
run: mvn -V --no-transfer-progress clean verify site:site site:stage
- name: 'Deploy to gh-pages'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: target/staging
TARGET_FOLDER: snapshot
45 changes: 45 additions & 0 deletions .github/workflows/jdkbuilds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: JDKBuilds

on:
push:
branches:
- master
- '*'
pull_request:
branches:
- '*'

jobs:
openjdk:
strategy:
matrix:
jdk: [jdk-8-slim, jdk-11-slim, jdk-13, jdk-14]
name: "OpenJDK ${{ matrix.jdk }}"
runs-on: ubuntu-latest
container: "maven:3.6.3-${{ matrix.jdk }}"
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.jdk }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-${{ matrix.jdk }}
- name: 'Build'
run: mvn -V --no-transfer-progress clean verify --fail-at-end
74 changes: 74 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: Main
on:
push:
branches:
- master
- '*'
pull_request:
branches:
- '*'

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
container: "maven:3.6.3-jdk-8-slim"
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-ubuntu-latest-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-ubuntu-latest
- name: 'Build'
run: mvn -V --no-transfer-progress clean verify --fail-at-end
windows:
name: 'Windows'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-windows-latest-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-windows-latest
- name: 'Set up JDK 8'
uses: actions/setup-java@v1
with:
java-version: 8
- name: 'Build'
shell: bash
run: mvn -V --no-transfer-progress clean verify --fail-at-end
mac:
name: 'Mac OS'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-macos-latest-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-macos-latest
- name: 'Set up JDK 8'
uses: actions/setup-java@v1
with:
java-version: 8
- name: 'Build'
run: mvn -V --no-transfer-progress clean verify --fail-at-end
41 changes: 41 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
on:
milestone:
types: [closed]
name: Generate Release Notes and Publish
jobs:
create-release-notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: create release notes from milestone ${{ github.event.milestone.title }}
uses: docker://decathlon/release-notes-generator-action:2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_FOLDER: temp_release_notes
- name: deploy release notes for milestone ${{ github.event.milestone.title }}
uses: ncipollo/release-action@v1
with:
replacesArtifacts: false
allowUpdates: true
bodyFile: temp_release_notes/release_file.md
draft: false
tag: ${{ github.event.milestone.title }}
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,44 @@
<!---
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# MojoHaus Parent

This is the parent pom for all [MojoHaus](https://www.mojohaus.org) Maven plugins and components.

[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license]
[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.mojo/mojo-parent.svg?label=Maven%20Central)](https://search.maven.org/search?q=g%3Aorg.codehaus.mojo+AND+a%3Amojo-parent)
[![Build Status](https://travis-ci.org/mojohaus/mojo-parent.svg?branch=master)](https://travis-ci.org/mojohaus/mojo-parent)
[![JDKBuilds](https://github.com/mojohaus/mojo-parent/workflows/JDKBuilds/badge.svg)][jdkbuilds]
[![Main](https://github.com/mojohaus/mojo-parent/workflows/Main/badge.svg)][mainbuilds]
[![SitePublishing](https://github.com/mojohaus/mojo-parent/workflows/SitePublishing/badge.svg)][published-site]

## Releasing

* Make sure the milestone name is name like `artifactId-number`. In this case `artifactId` is `mojo-parent`
and version is equalto the version of the pom without trailing `-SNAPSHOT`.
* Make sure `gpg-agent` is running.
* Execute `mvn -B release:prepare release:perform`

For publishing the site, do the following (assuming mono-module project):
For publishing the site, do the following (for all kinds of project):

```
cd target/checkout
mvn verify site site:stage scm-publish:publish-scm
```

[license]: https://www.apache.org/licenses/LICENSE-2.0
[jdkbuilds]: https://github.com/mojohaus/mojo-parent/actions?query=workflow%3AJDKBuilds
[mainbuilds]: https://github.com/mojohaus/mojo-parent/actions?query=workflow%3AMain
[published-site]: https://www.mojohaus.org/mojo-parent/
16 changes: 4 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@
<pubScmUrl>${project.scm.developerConnection}</pubScmUrl>
<scmBranch>gh-pages</scmBranch>
<content>${project.reporting.outputDirectory}</content><!-- mono-module doesn't require site:stage -->
<!--
! Ignore the snapshot path.
-->
<ignorePathsToDelete>snapshot</ignorePathsToDelete>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -575,18 +579,6 @@
</reporting>

<profiles>
<profile>
<!--
On travis-ci, the API rate limit for github reports is sometimes exceeded,
so only render this when not run on travis.
-->
<id>mojo-enable-githubreport-when-not-on-travis</id>
<activation>
<property>
<name>!env.CONTINUOUS_INTEGRATION</name>
</property>
</activation>
</profile>
<profile>
<id>mojo-release</id>
<build>
Expand Down

0 comments on commit 9fe14ae

Please sign in to comment.