Skip to content
Open
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
15 changes: 0 additions & 15 deletions .github/renovate.json

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build PR

on:
pull_request:

permissions:
contents: read
checks: write
pull-requests: write

jobs:
build:
# Shared org build: Temurin toolchain, 3-OS matrix, tests and coverage.
uses: OneLiteFeatherNET/workflows/.github/workflows/gradle-build-pr.yml@v2.8.1
with:
java-version: "17"
java-distribution: "temurin"
run-tests: false
secrets: inherit
12 changes: 4 additions & 8 deletions .github/workflows/close_invalid_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

on:
pull_request_target:
types: [ opened ]
types: [opened]

jobs:
run:
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'master' }}
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Please do not open pull requests from the `develop` branch, create a new branch instead."
close:
uses: OneLiteFeatherNET/workflows/.github/workflows/close-invalid-prs.yml@v2.8.1
secrets: inherit
Comment on lines +8 to +9
17 changes: 17 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR Lint

# Conventional Commits on the PR title and every commit on the branch.
# release-please parses those commit types to decide the version bump and to
# build the changelog - a non-conventional commit silently produces neither.
on:
pull_request:
types: [opened, edited, synchronize, reopened]

permissions:
contents: read
pull-requests: read

jobs:
lint:
uses: OneLiteFeatherNET/workflows/.github/workflows/pr-lint.yml@v2.8.1
secrets: inherit
31 changes: 0 additions & 31 deletions .github/workflows/publish.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/release-drafter.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

# release-please collects Conventional Commits into a release PR; merging it
# tags the version and cuts the GitHub release. Everything that has to happen
# for a release is chained into this same run on purpose: release-please tags
# with GITHUB_TOKEN, and a tag pushed that way does NOT start a separate
# `on: push: tags` workflow.
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pull-requests: write

jobs:
release-please:
uses: OneLiteFeatherNET/workflows/.github/workflows/release-please.yml@v2.8.1
secrets: inherit

publish:
name: Publish to Hangar and Modrinth
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout the released tag
uses: actions/checkout@v6
with:
ref: ${{ needs.release-please.outputs.tag_name }}

- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: "17"
architecture: x64
distribution: "temurin"

# Same sequence the tag-triggered publish workflow ran, with the version
# coming from release-please instead of from the pushed tag name.
- name: Publish with gradle
run: |
./gradlew applyPatches
./gradlew build
./gradlew publishAllPublicationsToHangar
./gradlew modrinth
env:
TAG_VERSION: ${{ needs.release-please.outputs.tag_name }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_KEY }}
HANGAR_KEY: ${{ secrets.HANGAR_KEY }}
sbom:
name: Attach SBOM to release
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ needs.release-please.outputs.tag_name }}

- name: Generate CycloneDX SBOM
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: fs
scan-ref: .
format: cyclonedx
output: bom.json
# An SBOM is an inventory, not a finding list - never fail on it.
exit-code: '0'

- name: Attach SBOM to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.release-please.outputs.tag_name }}
run: gh release upload "$TAG" bom.json --clobber
55 changes: 55 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Security

# Trivy vulnerability gate plus a CycloneDX SBOM of the repository. Self-contained
# on purpose: it needs no build tool and no registry credentials, so it is the
# baseline security gate for every repository regardless of language.
on:
pull_request:
push:
branches: [main]
schedule:
- cron: "37 3 * * 1"
workflow_dispatch:
permissions:
contents: read
security-events: write

jobs:
trivy:
name: Trivy scan
uses: OneLiteFeatherNET/workflows/.github/workflows/security-scan.yml@v2.8.1
with:
scan-type: "fs"
scanners: "vuln,secret"
severity: "CRITICAL,HIGH"
# Report-only for now, so adopting this does not turn CI red on day one.
fail-on-findings: false
upload-sarif: true
secrets: inherit

sbom:
name: CycloneDX SBOM
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Generate SBOM
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: fs
scan-ref: .
format: cyclonedx
output: bom.json
# An SBOM is an inventory, not a finding list - never fail on it.
exit-code: '0'

- name: Upload SBOM
uses: actions/upload-artifact@v4
with:
name: sbom-cyclonedx
path: bom.json
if-no-files-found: error
retention-days: 90
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.1"
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("dev.onelitefeather.glue") version "0.0.13"
}

val baseVersion = "1.0.0"
val baseVersion = "1.0.1" // x-release-please-version
version = System.getenv("TAG_VERSION") ?: "$baseVersion-dev"
group = "dev.onelitefeather.plugin"
glue {
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ['@commitlint/config-conventional'],
};
19 changes: 19 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "simple",
"include-component-in-tag": false,
"include-v-in-tag": true,
"packages": {
".": {
"package-name": "CoinCoffer",
"changelog-path": "CHANGELOG.md",
"extra-files": [
{
"type": "generic",
"path": "build.gradle.kts"
}
]
}
},
"bootstrap-sha": "bb09ff8e44acf0764e20410310def4598e235432"
}
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>OneLiteFeatherNET/renovate:default(OneLiteFeatherNET/coincoffer-maintainers)",
"github>OneLiteFeatherNET/renovate:paper"
],
"ignoreDeps": []
}
Loading