-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from samypr100/ci-integration
Adding GHA CI Support
- Loading branch information
Showing
16 changed files
with
366 additions
and
166 deletions.
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,34 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
# Sane defaults | ||
end_of_line = crlf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
# Java files | ||
[*.java] | ||
tab_width = 4 | ||
indent_size = 4 | ||
indent_style = space | ||
|
||
# XML files | ||
[*.{xml,fxml}] | ||
tab_width = 4 | ||
indent_size = 4 | ||
indent_style = space | ||
|
||
[*.css] | ||
tab_width = 4 | ||
indent_size = 4 | ||
indent_style = space | ||
|
||
# MD Files | ||
[*.md] | ||
ij_formatter_enabled = false |
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 @@ | ||
* text=auto eol=crlf |
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,100 @@ | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
release: | ||
types: [ "published" ] | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
# cancel in progress jobs or runs for the current workflow | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | ||
|
||
jobs: | ||
|
||
build-jar: | ||
|
||
name: jar / ${{ matrix.os }} / ${{ matrix.jdk-version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
jdk-version: [ 17 ] | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set Up JDK ${{ matrix.jdk-version }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.jdk-version }} | ||
distribution: 'temurin' | ||
|
||
- name: Set Up Maven | ||
uses: stCarolas/[email protected] | ||
with: | ||
maven-version: 3.8.8 | ||
|
||
- name: Cache Maven repository | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Import GPG Key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Setup Maven Revision | ||
shell: bash | ||
run: echo "project_revision=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
|
||
- name: Update Maven Revision As Snapshot | ||
if: github.event_name != 'release' | ||
shell: bash | ||
run: echo "project_revision=${{ env.project_revision }}-${GITHUB_SHA::6}-SNAPSHOT" >> $GITHUB_ENV | ||
|
||
- name: Maven Build and Verify Jar | ||
run: mvn -V -B -e -ff -ntp -P github,release-sign-artifacts -Drevision="${{ env.project_revision }}" clean verify | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: runner.os == 'Linux' | ||
continue-on-error: true | ||
with: | ||
name: LitFX-${{ env.project_revision }} | ||
path: | | ||
./**/target/*.pom | ||
./**/target/*.jar | ||
./**/target/*.asc | ||
retention-days: 10 | ||
if-no-files-found: error | ||
|
||
- name: Deploy Github Package | ||
if: runner.os == 'Linux' && (github.ref == 'refs/heads/master' || github.event_name == 'release') | ||
continue-on-error: true | ||
# LitFX is an invalid artifactId per GH Packages, using -fn to allow others to upload | ||
run: mvn -V -B -e -fn -ntp -P github,release-sign-artifacts -Drevision="${{ env.project_revision }}" deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Deploy OSSRH Package | ||
if: runner.os == 'Linux' && (github.ref == 'refs/heads/master' || github.event_name == 'release') | ||
run: mvn -V -B -e -ff -ntp -P ossrh,release-sign-artifacts -Drevision=${{ env.project_revision }} deploy | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
theme: jekyll-theme-midnight | ||
theme: jekyll-theme-midnight |
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
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
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
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
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
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
Oops, something went wrong.