Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update Changelog

concurrency: ci-${{ github.ref }}
on:
push:
branches:
- main
workflow_run:
workflows: ["Tag & Release"]
branches: [main]
types:
- completed

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Generate Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
headerLabel: "# 📑 Changelog"
breakingLabel: '### 💥 Breaking'
enhancementLabel: '### 🚀 Enhancements'
bugsLabel: '### 🐛 Bug fixes'
securityLabel: '### 🛡️ Security'
issuesLabel: '### 📁 Other issues'
prLabel: '### 📁 Other pull requests'
addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}'
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
author: true
unreleased: true
compareLink: true
stripGeneratorNotice: true
verbose: true

- name: Commit Changelog
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
git add CHANGELOG.md
git commit -m 'Update Changelog.'
git push

44 changes: 44 additions & 0 deletions .github/workflows/javadocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update JavaDocs

concurrency: ci-${{ github.ref }}
on:
workflow_run:
workflows: ["Tag & Release"]
branches: [main]
types:
- completed

jobs:
generate-javadocs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: 'main'

- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build JavaDocs
run: mvn -U clean verify -Pgenerate-site-javadoc

- name: Commit JavaDocs
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
git add docs
git commit -m 'Updating JavaDocs.'
git push

112 changes: 34 additions & 78 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
workflow_dispatch:
inputs:
version:
description: Tag/Version
description: Version
required: false

jobs:
tag-release:
tag:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

Expand Down Expand Up @@ -45,14 +45,15 @@ jobs:
run: echo "::set-output name=version::$(grep ^scm.tag= release.properties | sed -e 's/scm.tag=aio-lib-cloudmanager-//g')"

github-release:
needs: tag-release
needs: tag
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}
fetch-depth: 0 # Work around for https://github.com/heinrichreimer/action-github-changelog-generator/issues/21
ref: aio-lib-cloudmanager-${{ needs.tag.outputs.version }}

- name: Setup JDK
uses: actions/setup-java@v1
Expand All @@ -68,77 +69,54 @@ jobs:
${{ runner.os }}-maven-

- name: Maven Verify
run: mvn -U clean verify
run: mvn -U clean verify && mvn verify -P java8

- name: Generate Release Changelog
id: generate-release-changelog
uses: heinrichreimer/github-changelog-generator-action@v2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
author: true
compareLink: true
onlyLastTag: true
stripHeaders: true
stripGeneratorNotice: true

- name: Create Release
id: create_release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}
release_name: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}
body: |
See [Changelog](/CHANGELOG.md) for details.
tag_name: aio-lib-cloudmanager-${{ needs.tag.outputs.version }}
release_name: aio-lib-cloudmanager-${{ needs.tag.outputs.version }}
body: ${{ steps.generate-release-changelog.outputs.changelog }}
draft: false
prerelease: false

- name: Upload Jar
id: upload-release-jar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}.jar
asset_name: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}.jar
asset_content_type: application/java-archive

- name: Upload JavaDoc Jar
id: upload-release-javadoc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}-javadoc.jar
asset_name: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}-javadoc.jar
asset_content_type: application/java-archive

- name: Upload Sources Jar
id: upload-release-sources
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}-sources.jar
asset_name: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}-sources.jar
asset_content_type: application/java-archive

- name: Maven Verify
run: mvn -U clean verify -P java8

- name: Upload Java8 Jar
id: upload-java8-release-jar
uses: actions/upload-release-asset@v1
- name: Upload Release Artifacts
id: upload-release-artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}-java8.jar
asset_name: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}-java8.jar
asset_content_type: application/java-archive
tag_name: aio-lib-cloudmanager-${{ needs.tag.outputs.version }}
files: |
./target/aio-lib-cloudmanager-*.jar

maven-central-deploy:
needs: tag-release
needs: tag
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: aio-lib-cloudmanager-${{ needs.tag-release.outputs.version }}
ref: aio-lib-cloudmanager-${{ needs.tag.outputs.version }}

# See https://github.com/actions/setup-java#publishing-using-apache-maven
- name: Setup JDK
Expand Down Expand Up @@ -174,31 +152,9 @@ jobs:
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Publish to Apache Maven Central
- name: Publish Java8 to Apache Maven Central
run: mvn clean deploy -P release,java8 -DautoReleaseAfterClose=true
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

changelog:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Generate Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.2
with:
issues: false
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit Changelog
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
git add CHANGELOG.md
git commit -m 'Update Changelog.'
git push
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy SNAPSHOT
name: Snapshot Deploy

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build & Verify

on:
pull_request:
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,38 @@ Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING

Please run the and include the output from the `generate-javadoc` Maven profile for any Pull Requests, to keep the documentation up-to-date.

### GitHub Actions

#### Tag & Release

This is the only action that requires a user to activate manually.

Releasing a version of the library can be done by activating the [Tag & Release](./actions/workflows/release.yaml) action.

The version is optional, if unspecified it will use whatever Maven determines is the next release.

#### Snapshot Deploy

Activated on every commit to the `main` branch.

Automatically deploy a SNAPSHOT of the current build to Maven Central's snapshot repository.

#### Build & Verify

Activated on every pull request to the `main` branch.

Automatically run a build and tests for the project.

#### Update Changelog

Activated on every commit to the `main` branch.

This will automatically update the [Changelog](./CHANGELOG.md) from Pull Requests or Issues, and commit it back to the `main` branch.

#### Update JavaDoc

Activated after every successful [Tag & Release](#tag--release) run. This will run the Maven profile for generating the Project JavaDocs and commit them back to the `main` branch. This will keep them always up-to-date with the latest release.

### Licensing

This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.