forked from mfnalex/CustomBlockData
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
226 additions
and
104 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
discussions: write | ||
pull-requests: write | ||
|
||
jobs: | ||
tests: | ||
name: Tests | ||
uses: ./.github/workflows/tests.yml | ||
release: | ||
name: Build | ||
needs: [tests] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
java: [17] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Checkout repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
# Build setup | ||
- name: Setup JDK | ||
uses: ./.github/actions/jdk | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Setup Gradle | ||
uses: ./.github/actions/gradle | ||
|
||
# Makes the next semantic tag variable available for use in workflow | ||
- uses: jveldboom/action-conventional-versioning@v1 | ||
id: version | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
default-bump: patch | ||
|
||
# Build and upload to Maven | ||
- name: Build with Gradle & Publish to Maven | ||
run: ./gradlew clean build publishAllPublicationsToReleasesRepository -PcustomVersion=${{ steps.version.outputs.version }} --info | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_NAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_SECRET }} | ||
|
||
# Generate changelog | ||
- name: 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: ${{ steps.version.outputs.version-with-prefix }} | ||
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: | ||
name: ${{ steps.version.outputs.version-with-prefix }} | ||
tag_name: ${{ steps.version.outputs.version }} | ||
generate_release_notes: false | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
files: | | ||
${{ github.workspace }}/build/libs/* | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: false | ||
prerelease: ${{ contains(github.ref_name, '-RC-') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Snapshot | ||
|
||
on: | ||
push: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
discussions: write | ||
pull-requests: write | ||
|
||
jobs: | ||
tests: | ||
name: Tests | ||
uses: ./.github/workflows/tests.yml | ||
snapshot: | ||
name: Build | ||
needs: [tests] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
java: [17] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Checkout repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
# Build setup | ||
- name: Setup JDK | ||
uses: ./.github/actions/jdk | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Setup Gradle | ||
uses: ./.github/actions/gradle | ||
|
||
# Makes the next semantic tag variable available for use in workflow | ||
- uses: jveldboom/action-conventional-versioning@v1 | ||
id: version | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
default-bump: patch | ||
|
||
# If on main branch, upload snapshot to maven | ||
- name: Build with Gradle & Publish to Maven | ||
if: contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref) | ||
run: ./gradlew clean build publishAllPublicationsToSnapshotsRepository -PcustomVersion=${{ steps.version.outputs.version }}-SNAPSHOT-${{ github.run_number }} --info | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_NAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_SECRET }} | ||
|
||
# Else if, upload built jar from push | ||
- name: Build with Gradle | ||
if: contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref) == false | ||
run: ./gradlew clean build -PcustomVersion=${{ steps.version.outputs.version }}-SNAPSHOT-${{ github.run_number }} --info | ||
|
||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
if: contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref) == false | ||
with: | ||
name: Build ${{ steps.version.outputs.version-with-prefix }}-SNAPSHOT-${{ github.run_number }} | ||
path: ${{ github.workspace }}/build/libs/ | ||
retention-days: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
discussions: write | ||
pull-requests: write | ||
|
||
jobs: | ||
test-build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
java: [17] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Checkout repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
# Setup JDK | ||
- name: Setup JDK | ||
uses: ./.github/actions/jdk | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
# Setup Gradle & Verify wrapper | ||
- name: Setup Gradle | ||
uses: ./.github/actions/gradle | ||
|
||
# Makes the next semantic tag variable available for use in workflow | ||
- uses: jveldboom/action-conventional-versioning@v1 | ||
id: version | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
default-bump: patch | ||
|
||
# Build with Gradle | ||
- name: Build with Gradle | ||
run: ./gradlew clean build -PcustomVersion=${{ steps.version.outputs.version }}-SNAPSHOT-${{ github.run_number }} --info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters