Skip to content

Commit

Permalink
release_prep: update to latest build conventions (#110)
Browse files Browse the repository at this point in the history
* release_prep: update to latest build conventions
  • Loading branch information
big-andy-coates committed Nov 7, 2022
1 parent af0275f commit ea5d38b
Show file tree
Hide file tree
Showing 19 changed files with 750 additions and 228 deletions.
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### Labels
Mark your PRs with the following labels, as appropriate:
- `breaking-change`: if the PR includes a breaking change
- `enhancement`: if the PR enables / completes a new feature
- `bug`: if the PR fixes a bug.
- `dependencies`: if the PR updates dependencies
- `documentation **`: If the PR doc-only changes
- `subtask **`: If the PR is only part of a new feature. Ensure final PR is marked with `enhancement`.
- `chore **`: a maintenance / non-feature released task of no interest to users.

Labels marked with `**` are excluded from release notes

### Reviewer checklist
- [ ] Ensure relevant issues are linked (description should include text like "Fixes #<issue number>")
- [ ] Ensure correct labels applied
- [ ] Ensure any appropriate documentation has been added or amended
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ updates:
registries:
- creek-github-packages
schedule:
interval: weekly
interval: monthly
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
exclude:
labels:
- documentation
- subtask
- chore
categories:
- title: Breaking Changes 🛠
labels: [ breaking-change ]

- title: Exciting New Features 🎉
labels: [ enhancement ]

- title: Bug Fixes 🎉
labels: [ bug ]

- title: Dependency Updates
labels: [ dependencies ]

- title: Less Exciting Things
labels: [ "*" ]
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build

on:
push:
branches: [ main ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
publish_artifacts:
description: "Publish release artifacts: true or false?"
default: "true"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- name: Fetch version history
# Do NOT want to fetch all tags if build specific tag.
# Doing so could result in code published with wrong version, if newer tags have been pushed
if: (!startsWith(github.ref, 'refs/tags/'))
run: git fetch --tag --unshallow
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew javadoc check coveralls
- name: Publish
if: github.event_name == 'push' || github.event.inputs.publish_artifacts == 'true'
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
ORG_GRADLE_PROJECT_SONA_USERNAME: ${{ secrets.SONA_USERNAME }}
ORG_GRADLE_PROJECT_SONA_PASSWORD: ${{ secrets.SONA_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew cV
./gradlew publish closeAndReleaseStagingRepository
- name: Publish to Gradle Plugins Portal
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha')
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
run: |
./gradlew -Dgradle.publish.key="$GRADLE_PUBLISH_KEY" -Dgradle.publish.secret="$GRADLE_PUBLISH_SECRET" publishPlugins
create-gh-release:
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3.1.0
- name: Create GitHut Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
4 changes: 0 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CodeQL

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -40,8 +38,6 @@ jobs:
run: chmod +x gradlew

- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew test

- name: Perform CodeQL Analysis
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/gradle.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# A Workflow for triggering a new release.

name: Release

on: [workflow_dispatch]

concurrency: "${{ github.repository }}-versioning"

jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3.1.0
with:
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }}
- name: Fetch version history
run: git fetch --tags --unshallow
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Ensure build is green
run: ./gradlew check
- name: Release
run: |
# The following command will trigger the build.yml workflow as it pushes a release tag
./gradlew release
28 changes: 19 additions & 9 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
name: Version
# A Workflow for adjusting the version number of the next release

name: Set next version

on:
workflow_dispatch:
inputs:
part:
description: "Part to increment: Major, Minor or Patch"
description: "Part to increment: Major, Minor, Patch or the next release, e.g. 1.2.3"
required: true
default: Patch
default: Minor

concurrency: "${{ github.repository }}-versioning"

jobs:
version:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
with:
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }}
- name: Fetch version history
run: git fetch --tags --unshallow
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand All @@ -21,12 +30,13 @@ jobs:
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Increment Version Part
- name: Increment version
if: contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part)
run: |
git fetch --tags --unshallow
# The following command will trigger the build.yml workflow as it pushes a alpha tag
./gradlew markNextVersion -Prelease.incrementer=increment${{ github.event.inputs.part }}
- name: Trigger Build
- name: Set next version
if: (!contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part))
run: |
curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${{ github.repository }}/actions/workflows/gradle.yml/dispatches" -d '{"ref":"main","inputs":{"publish":"true"}}'
env:
GITHUB_TOKEN: ${{ secrets.TRIGGER_GITHUB_TOKEN }}
# The following command will trigger the build.yml workflow as it pushes a alpha tag
./gradlew markNextVersion -Prelease.version=${{ github.event.inputs.part }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ out
*.ipr
*.iws
.idea

# Apple
**/.DS_Store
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Coverage Status](https://coveralls.io/repos/github/creek-service/creek-service/badge.svg?branch=main)](https://coveralls.io/github/creek-service/creek-service?branch=main)
[![build](https://github.com/creek-service/creek-service/actions/workflows/gradle.yml/badge.svg)](https://github.com/creek-service/creek-service/actions/workflows/gradle.yml)
[![build](https://github.com/creek-service/creek-service/actions/workflows/build.yml/badge.svg)](https://github.com/creek-service/creek-service/actions/workflows/build.yml)
[![CodeQL](https://github.com/creek-service/creek-service/actions/workflows/codeql.yml/badge.svg)](https://github.com/creek-service/creek-service/actions/workflows/codeql.yml)

# Creek Service

The core of the Creek system.

See [CreekService.org](https://www.creekservice.org) for info on Creek Service.

## Modules

* **[context](context)**: Provides features to make it easier to write Kafka and Kafka Streams based microservices.
* **[extension](extension)**: Contains base types used to implement a Creek service extension and a means of loading extensions
* **[test-java-eight](test-java-eight)**: Contains functional testing extension loading *without* Java 9 modularity
Expand Down

0 comments on commit ea5d38b

Please sign in to comment.