Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven-publish: abstract and definitive scripts #45

Merged
merged 37 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5e8e77c
maven-publish: abstract and definitive scripts
Scrappers-glitch Mar 22, 2023
7a82669
Create build-deploy.yml
Scrappers-glitch Mar 22, 2023
d6d2e6c
build-deploy.yml: deploy release java and native doc
Scrappers-glitch Mar 22, 2023
8efde31
build-deploy.yml: added r/w permissions and enabled manual run
Scrappers-glitch Mar 22, 2023
5b7f00f
abstract-publish.sh: removed the `-debug` flag
Scrappers-glitch Mar 22, 2023
faf9633
jme3-alloc-native/build.gradle: better handling of version
Scrappers-glitch Mar 22, 2023
18295e7
Project: build and workflow config fixes
Scrappers-glitch Mar 22, 2023
c1a3f89
jme3-alloc-native/build.gradle: added missing imports
Scrappers-glitch Mar 22, 2023
439f24b
Attempt to fix the incompatibile APIs and public keys
Scrappers-glitch Mar 23, 2023
479083a
Update build-deploy.yml
Scrappers-glitch Mar 23, 2023
d39ab12
Update build-deploy.yml
Scrappers-glitch Mar 23, 2023
a040a81
publishing-scripts: removed the abstract-publish and simplifications
Scrappers-glitch Mar 23, 2023
ca5aef9
removed maven binaries
Scrappers-glitch Mar 23, 2023
0ea2727
build-deploy.yml: setup maven-3.9
Scrappers-glitch Mar 23, 2023
2cf1c7a
build-deploy.yml: fixed `install-latest-maven` relative path
Scrappers-glitch Mar 23, 2023
96a46dc
install-maven-latest.sh: removed the mv command
Scrappers-glitch Mar 23, 2023
287b71d
build-deploy.yml: removed other java versions
Scrappers-glitch Mar 23, 2023
64aa393
Update build-deploy.yml
Scrappers-glitch Mar 23, 2023
b008186
Update jme-alloc.pom: use explicit version of plexus-util
Scrappers-glitch Mar 23, 2023
0dcbb8c
Update build-deploy.yml
Scrappers-glitch Mar 23, 2023
7310d69
build-deploy.yml: fixed broken publish-script path
Scrappers-glitch Mar 23, 2023
6c5b5d0
build-deploy.yml: fixed assemble-android
Scrappers-glitch Mar 23, 2023
9856781
build.yml: fixed assemble android
Scrappers-glitch Mar 23, 2023
b4f2121
build.yml: revert assemble-android
Scrappers-glitch Mar 23, 2023
158762e
build-deploy.yml: attempt to fix android jar not found
Scrappers-glitch Mar 23, 2023
4e1a27c
build-deploy.yml: refactored to `trustdb`
Scrappers-glitch Mar 23, 2023
79b259b
Update build-deploy.yml
Scrappers-glitch Mar 23, 2023
672322f
build-deploy: import public key
Scrappers-glitch Mar 23, 2023
e37fe10
build-deploy: attempt to fix gnu-gpg errors
Scrappers-glitch Mar 24, 2023
0fe7379
build-deploy.yml: added env secrets
Scrappers-glitch Mar 24, 2023
88982a3
build-deploy.yml: added the env vars to the correct deploy-step
Scrappers-glitch Mar 24, 2023
5db86e7
build-deploy.yml: deploy the public key
Scrappers-glitch Mar 24, 2023
c6aed91
sonatype-publish-artifacts.sh: added autogenerate pomfile
Scrappers-glitch Mar 24, 2023
693fe9a
publishing: separate pom-files for android and desktop
Scrappers-glitch Mar 24, 2023
b076168
sonatype-publishing: dynamic generation of POM files
Scrappers-glitch Mar 24, 2023
265ab54
build-deploy.yml: generic site destination
Scrappers-glitch Mar 24, 2023
4dd86b7
build-deploy.yml: deferred website-doc deployment
Scrappers-glitch Mar 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
354 changes: 354 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,354 @@
# This workflow builds the API and releases it to Maven-Sonatype-Central repository

name: Build and deploy jme-alloc

# Runs this workflow [on-release] only
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
release:
types: [published, prereleased]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
compile-java:
# runner images with architectures (variants)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Compile java

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3

- name: Setup Oracle-JDK-19
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '19'

- name: Compiling java
run: ./gradlew --console="verbose" :jme3-alloc:compileJava

- name: Archive byte code
uses: actions/upload-artifact@v3
with:
name: byte-code
path: jme3-alloc/build/classes/java/main/

- name: Archive jni headers
uses: actions/upload-artifact@v3
with:
name: jni-headers
path: jme3-alloc-native/src/include/

compile-natives:
# runner images with architectures (variants)
runs-on: ${{ matrix.os }}
needs: compile-java
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
name: Compile natives on ${{ matrix.os }} for x86-64 and x86

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3

- name: Setup Oracle-JDK-19
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '19'

- name: Download jni headers
uses: actions/download-artifact@v3
with:
name: jni-headers
path: jme3-alloc-native/src/include/

- name: Prepare build directory
run: ./gradlew --console="verbose" :jme3-alloc-native:prepareDesktopOutputDirectory

- name: Compiling x86-64 on ${{ matrix.os }}
run: ./gradlew --console="verbose" :jme3-alloc-native:compileX86_64

- name: Install gcc-multilib
run: bash ./helper-scripts/abstract/install-gcc-multilib.sh

- name: Compiling x86 on ${{ matrix.os }}
run: ./gradlew --console="verbose" :jme3-alloc-native:compileX86

- name: Archive libjmealloc.so
uses: actions/upload-artifact@v3
with:
name: libjmealloc-${{ matrix.os }}
path: jme3-alloc-native/build/

assemble-desktop:
# runner images with architectures (variants)
runs-on: ${{ matrix.os }}
needs: compile-natives
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Assemble jme3-alloc-desktop

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3

- name: Setup Oracle-JDK-19
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '19'

- name: Downloading libjmealloc-ubuntu-latest
uses: actions/download-artifact@v3
with:
name: libjmealloc-ubuntu-latest
path: jme3-alloc-native/build/

- name: Downloading libjmealloc-macos-latest
uses: actions/download-artifact@v3
with:
name: libjmealloc-macos-latest
path: jme3-alloc-native/build/

- name: Downloading libjmealloc-windows-latest
uses: actions/download-artifact@v3
with:
name: libjmealloc-windows-latest
path: jme3-alloc-native/build/

- name: Downloading byte code
uses: actions/download-artifact@v3
with:
name: byte-code
path: jme3-alloc/build/classes/java/main/

- name: Copying natives
run: ./gradlew --console="verbose" :jme3-alloc-native:copyNatives

- name: List build
run: tree jme3-alloc/build/classes/java/main/

- name: Assemble
run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :jme3-alloc:desktop && ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :jme3-alloc:assemble

- name: Log jar
run: tree jme3-alloc/build/libs/

- name: Archive release
uses: actions/upload-artifact@v3
with:
name: jme3-alloc-desktop-release
path: jme3-alloc/build/libs/*.jar

compile-android-natives:
# a linux runner image with the ndk installed and llvm ready to compile android native binaries
runs-on: ${{ matrix.os }}
needs: compile-java
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Compiling android native binaries

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3

- name: Setup Oracle-JDK-19
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '19'

- name: Download jni headers
uses: actions/download-artifact@v3
with:
name: jni-headers
path: jme3-alloc-native/src/include/

- name: Prepare build directory
run: ./gradlew --console="verbose" :jme3-alloc-native:prepareAndroidOutputDirectory

- name: Compiling android native binaries
run: ./gradlew --console="verbose" :jme3-alloc-native:compileAndroid

- name: Archive libjmealloc.so
uses: actions/upload-artifact@v3
with:
name: libjmealloc-android
path: jme3-alloc-native/build/

assemble-android:
# runner images with architectures (variants)
runs-on: ${{ matrix.os }}
needs: compile-android-natives
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Assembling jme3-alloc-android native binaries

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3

- name: Setup Oracle-JDK-19
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '19'

- name: Downloading libjmealloc-android
uses: actions/download-artifact@v3
with:
name: libjmealloc-android
path: jme3-alloc-native/build/

- name: Downloading byte code
uses: actions/download-artifact@v3
with:
name: byte-code
path: jme3-alloc/build/classes/java/main/

- name: Copying natives
run: ./gradlew --console="verbose" :jme3-alloc-native:copyNatives

- name: List build
run: tree jme3-alloc/build/classes/java/main/

- name: Assemble
run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :jme3-alloc:android && ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :jme3-alloc:assemble

- name: Log jar
run: tree jme3-alloc/build/libs/

- name: Archive release
uses: actions/upload-artifact@v3
with:
name: jme3-alloc-android-release
path: jme3-alloc/build/libs/*.jar

deploy:
environment:
name: maven-central
url: ""
runs-on: ${{ matrix.os }}
needs: [assemble-desktop, assemble-android]
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Deploying to Maven-Central repository

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3

- name: Setup Temurin-OpenJDK-17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Setup maven-3.9
run: |
# remove shipped maven-3.8 that causes the plexus plugin incompatibility behavior
sudo apt remove maven
# installs maven-3.9 with the fixed plugins patch
chmod +rwx ./helper-scripts/project-impl/publishing/install-maven-latest.sh
./helper-scripts/project-impl/publishing/install-maven-latest.sh

- name: Use Predefined PGP Keybox
run: gpg --import ./helper-scripts/project-impl/publishing/public-key.pub

- name: Import secret-key
run: gpg --allow-secret-key-import --import --batch --yes --passphrase="jme-alloc" ./helper-scripts/project-impl/publishing/secret-key

- name: Import owner-trust
run: gpg --import-ownertrust ./helper-scripts/project-impl/publishing/owner-trust.txt

- name: Send public key 'jme-alloc'
# sends the public key to a maven compatible host
run: gpg --keyserver keyserver.ubuntu.com --send-keys 8DB84BBFCFCCCA00EF7A53A8022AE2B9E8991B20

- name: Generate sources jar
run: ./gradlew -Pversion=$GITHUB_REF_NAME :jme3-alloc:generateSourcesJar

- name: Generate javadoc jar
run: ./gradlew -Pversion=$GITHUB_REF_NAME :jme3-alloc:generateJavadocJar

- name: Download desktop jar
uses: actions/download-artifact@v3
with:
name: jme3-alloc-desktop-release
path: jme3-alloc/build/libs/

- name: Download android jar
uses: actions/download-artifact@v3
with:
name: jme3-alloc-android-release
path: jme3-alloc/build/libs/

- name: Deploying jme3-alloc binaries
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
run: |
chmod +rwx ./helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh
# publish artifacts using the tag version
./helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh $GITHUB_REF_NAME

deploy-doc:
environment:
name: release-documentation
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Generate javadoc
run: chmod +rwx ./gradlew && ./gradlew :jme3-alloc:generateJavadocJar

- name: Move javadocs to the deployment folder 'website'
run: ./gradlew -Pversion=${GITHUB_REF_NAME} :jme3-alloc:manipulateJavadocForWebsite

- name: Setup Doxygen
run: sudo apt-get install doxygen

- name: Generate Native doc
run: ./gradlew -Pversion=${GITHUB_REF_NAME} :jme3-alloc-native:generateNativeDoc

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./website
destination: ./_site

- name: Upload artifact
uses: actions/upload-pages-artifact@v1

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
/jme3-alloc-examples/*.log

/jme3-alloc-android-example/build
/jme3-alloc-android-example/bin
/jme3-alloc-android-example/bin

/apache-maven-3.9.1
/apache-maven-3.9.1-bin.tar.gz
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import com.jme3.build.util.JarMetadata;

plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
}
}

// get the version from the gradle properties, default is 'SNAPSHOT'
JarMetadata.VERSION.setData("${version}")
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ repositories {

dependencies {
testImplementation 'junit:junit:4.13'
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
compileMacX86Property=false
compileWindowsX86Property=false
compileLinuxX86Property=true
version=SNAPSHOT

# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
Expand Down