-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable GitHub Actions builds * Control version from CI * Automatic GitHub releases * Set task names * Fix tag pattern * Change default version to 1.0
- Loading branch information
Showing
4 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
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,42 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- 'v*.*' | ||
workflow_call: | ||
inputs: | ||
version: | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: Gradle build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: version | ||
name: Detect version | ||
run: echo "version=${VERSION:-1.0+git-${GITHUB_SHA::7}}" >> $GITHUB_OUTPUT | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Build | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
build | ||
-Pversion=${{ steps.version.outputs.version }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: gradle-build | ||
path: build/libs/*-all.jar |
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,47 @@ | ||
name: GitHub release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
version: | ||
name: Extract version from git | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- id: version | ||
name: Extract version | ||
run: | | ||
TAG=${{ github.ref }} | ||
VERSION=${TAG#refs/tags/v} | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
build: | ||
name: Build | ||
needs: version | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
version: ${{ needs.version.outputs.version }} | ||
release: | ||
name: Prepare release | ||
needs: | ||
- version | ||
- build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: gradle-build | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ needs.version.outputs.version }} | ||
generate_release_notes: true | ||
draft: true | ||
files: '*' |
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ plugins { | |
} | ||
|
||
group = "info.mmpa" | ||
version = "1.0-SNAPSHOT" | ||
|
||
repositories { | ||
mavenCentral() | ||
|
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,3 @@ | ||
# Default development version | ||
# See: ./.github/workflows/build.yml | ||
version=1.0-SNAPSHOT |