Skip to content

Commit

Permalink
patch: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Im-Fran committed Jan 31, 2024
1 parent de06016 commit 7528ffe
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 45 deletions.
82 changes: 41 additions & 41 deletions .github/workflows/deploy-development.yml
@@ -1,41 +1,41 @@
#name: "Build and Deploy [development]"
#on:
# push:
# paths: [ 'simplecoreapi/**' ]
#jobs:
# build:
# name: "Build and Deploy [development]"
# if: ${{ github.ref != 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]') }}
# # Set up the OS
# runs-on: ubuntu-latest
# env:
# # Sonatype Credentials & GitHub token
# SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
# SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
# GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
# # Set environment
# ENV: 'dev'
# steps:
# # Checkout the Code
# - name: Checkout Code
# uses: actions/checkout@v4
# # Set up git hashes environment variables
# - name: Git Hashes
# uses: Im-Fran/git-hashes-action@v1.0.3
# # Set up the JDK
# - name: Set up JDK 11
# uses: actions/setup-java@v4
# with:
# distribution: adopt
# java-version: 11
# # Clean, Test, Publish and Build (in that order to save the artifact to the action)
# - name: Build with Gradle
# uses: gradle/gradle-build-action@v2
# with:
# arguments: clean test shadowJar dokkaHtml publish publishToSonatype closeAndReleaseSonatypeStagingRepository
# # Now we store the artifact in the action
# - name: Upload the artifact
# uses: actions/upload-artifact@v5
# with:
# name: SimpleCoreAPI
# path: ./simplecoreapi/build/libs/SimpleCoreAPI-${{ env.GIT_COMMIT_SHORT_HASH }}.jar
name: "Build and Deploy [development]"
on:
push:
paths: [ 'simplecoreapi/**' ]
jobs:
build:
name: "Build and Deploy [development]"
if: ${{ github.ref != 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]') }}
# Set up the OS
runs-on: ubuntu-latest
env:
# Sonatype Credentials & GitHub token
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
# Set environment
ENV: 'dev'
steps:
# Checkout the Code
- name: Checkout Code
uses: actions/checkout@v4
# Set up git hashes environment variables
- name: Git Hashes
uses: Im-Fran/git-hashes-action@v1.0.3
# Set up the JDK
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11
# Clean, Test, Publish and Build (in that order to save the artifact to the action)
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: clean test shadowJar dokkaHtml publish sonatypeCentralUpload
# Now we store the artifact in the action
- name: Upload the artifact
uses: actions/upload-artifact@v5
with:
name: SimpleCoreAPI
path: ./simplecoreapi/build/libs/simplecoreapi-${{ env.GIT_COMMIT_SHORT_HASH }}.jar
7 changes: 5 additions & 2 deletions .github/workflows/deploy-production.yml
Expand Up @@ -11,6 +11,9 @@ jobs:
# Sonatype Credentials & GitHub token
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
PUBLIC_KEY: '${{ secrets.PUBLIC_KEY }}'
SIGNING_KEY: '${{ secrets.SIGNING_KEY }}'
SIGNING_PASSWORD: '${{ secrets.SIGNING_PASSWORD }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
# Set environment
ENV: 'prod'
Expand Down Expand Up @@ -42,12 +45,12 @@ jobs:
uses: actions/upload-artifact@v5
with:
name: SimpleCoreAPI
path: ./simplecoreapi/build/libs/SimpleCoreAPI-${{ env.VERSION }}.jar
path: ./simplecoreapi/build/libs/simplecoreapi-${{ env.VERSION }}.jar
# Here we upload the binary to the release
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: ./simplecoreapi/build/libs/SimpleCoreAPI-${{ env.VERSION }}.jar application/java-archive
args: ./simplecoreapi/build/libs/simplecoreapi-${{ env.VERSION }}.jar application/java-archive
# Now we deploy the documents to GitHub pages
- name: Deploy Dokka
uses: JamesIves/github-pages-deploy-action@v4.5.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-test.yml
Expand Up @@ -31,4 +31,4 @@ jobs:
run: chmod +x gradlew
# Test building without dokka
- name: Build Jar with Java ${{ matrix.java-version }}
run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon
run: ./gradlew clean shadowJar test -x dokkaHtml -x sonatypeCentralUpload -no-daemon
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Expand Up @@ -7,4 +7,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2

0 comments on commit 7528ffe

Please sign in to comment.