Skip to content

Commit

Permalink
Release prep: update to new release conventions (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
big-andy-coates authored Nov 6, 2022
1 parent 78ead0c commit 0a23b97
Show file tree
Hide file tree
Showing 18 changed files with 486 additions and 226 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
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: [ "*" ]
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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/[email protected]
- 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
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/[email protected]
- name: Create GitHut Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
6 changes: 1 addition & 5 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 All @@ -22,7 +20,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v3.1.0

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand All @@ -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/[email protected]
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
30 changes: 20 additions & 10 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
- uses: actions/[email protected]
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[![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-json-schema/badge.svg?branch=main)](https://coveralls.io/github/creek-service/creek-json-schema?branch=main)
[![build](https://github.com/creek-service/creek-json-schema/actions/workflows/gradle.yml/badge.svg)](https://github.com/creek-service/creek-json-schema/actions/workflows/gradle.yml)
[![build](https://github.com/creek-service/creek-json-schema/actions/workflows/build.yml/badge.svg)](https://github.com/creek-service/creek-json-schema/actions/workflows/build.yml)
[![CodeQL](https://github.com/creek-service/creek-json-schema/actions/workflows/codeql.yml/badge.svg)](https://github.com/creek-service/creek-json-schema/actions/workflows/codeql.yml)

# Creek JSON Schema

Annotations and code for generating JSON schemas from JVM classes.

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

## Modules in this repo

* [generator](generator): a command line tool used to generate JSON schemas from code.
Expand Down
Loading

0 comments on commit 0a23b97

Please sign in to comment.