Skip to content

Commit

Permalink
ci: publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
darksaid98 committed Dec 26, 2024
1 parent ef03ca0 commit acc5c71
Show file tree
Hide file tree
Showing 12 changed files with 347 additions and 212 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @darksaid98
10 changes: 6 additions & 4 deletions .github/actions/gradle/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Gradle'
description: 'Grant execute permissions and validate Gradle wrapper'
description: 'Grant execute permissions, validate Gradle wrapper, setup Gradle wrapper'

runs:
using: 'composite'
Expand All @@ -9,7 +9,9 @@ runs:
shell: bash

- name: Validate Gradle Wrapper Authenticity
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v4

- name: Setup Gradle and Caching
uses: gradle/actions/setup-gradle@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary: 'on-failure'
8 changes: 6 additions & 2 deletions .github/actions/jdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ description: 'Set up JDK'
inputs:
java-version:
description: 'Java version'
required: true
required: false
default: '8'
distribution:
description: 'JDK Distribution'
required: false
default: 'temurin'

runs:
using: 'composite'
Expand All @@ -14,4 +18,4 @@ runs:
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
distribution: ${{ inputs.distribution }}
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "ci:"
target-branch: "main"
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "build:"
target-branch: "main"
groups:
"org.flywaydb":
patterns:
- "org.flywaydb*"
"org.jooq":
patterns:
- "org.jooq*"
"net.kyori":
patterns:
- "net.kyori*"
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI/CD

on:
push:
branches:
- "main"
- "master"
tags:
- "*.*.*"
pull_request:
branches:
- "*"
workflow_dispatch:

permissions:
attestations: write
contents: write
id-token: write
checks: write

concurrency:
group: ${{ format('{0}-{1}', github.job, github.ref) }}
cancel-in-progress: true

jobs:
test:
name: Test
uses: ./.github/workflows/test.yml
with:
os: ubuntu-latest
java: 21

stage:
name: Stage
needs: test
if: ${{ github.event_name != 'pull_request' }}
uses: ./.github/workflows/stage.yml
with:
os: ubuntu-latest
java: 21
secrets: inherit

deploy:
name: Deploy
needs: stage
if: github.ref_type == 'tag'
uses: ./.github/workflows/deploy.yml
with:
os: ubuntu-latest
secrets: inherit
67 changes: 67 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy

on:
workflow_call:
inputs:
os:
description: "The os the workflow shold use"
required: false
type: string
default: ubuntu-latest

permissions:
contents: write

jobs:
deploy:
name: "Release"
runs-on: ${{ inputs.os }}
steps:
- name: Download Snapshot
uses: actions/download-artifact@v4
with:
name: Release
run-id: ${{ github.event.workflow_run.id }}
path: "${{ github.workspace }}/tmp/"

# Generate changelog
- name: Generate Changelog
uses: ardalanamini/auto-changelog@v4
id: changelog
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-types: |
feat: New Features
fix: Bug Fixes
build: Build System & Dependencies
perf: Performance Improvements
docs: Documentation
test: Tests
refactor: Refactors
chore: Chores
ci: CI
style: Code Style
revert: Reverts
default-commit-type: Other Changes
release-name: ${{ github.ref_name }}
mention-authors: true
mention-new-contributors: true
include-compare-link: true
include-pr-links: true
include-commit-links: true
semver: true
use-github-autolink: true

# Create release
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ github.workspace }}/tmp/*
fail_on_unmatched_files: true
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, '-RC-') }}
generate_release_notes: false
body: ${{ steps.changelog.outputs.changelog }}
95 changes: 0 additions & 95 deletions .github/workflows/releases.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/snapshots.yml

This file was deleted.

Loading

0 comments on commit acc5c71

Please sign in to comment.