-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Articular-ES: testing and deployment scripting
- Loading branch information
1 parent
9a2da6b
commit e8f7213
Showing
14 changed files
with
408 additions
and
15 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,110 @@ | ||
# This workflow builds the API and releases it to Maven-Sonatype-Central repository | ||
|
||
name: Build and deploy Articular-ES | ||
|
||
# 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] | ||
# 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-assemble: | ||
# runner images with architectures (variants) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-latest' ] | ||
name: Compile java and articular-es jar | ||
|
||
# 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-19 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
|
||
- name: Building articular-es | ||
run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :articular-es:build | ||
|
||
- name: Generate articular-es sources jar | ||
run: ./gradlew -Pversion=$GITHUB_REF_NAME :articular-es:generateSourcesJar | ||
|
||
- name: Generate articular-es javadoc jar | ||
run: ./gradlew -Pversion=$GITHUB_REF_NAME :articular-es:generateJavadocJar | ||
|
||
- name: Archive articular-es | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: articular-build | ||
path: articular-es/build/libs | ||
|
||
deploy: | ||
environment: | ||
name: maven-central | ||
url: https://repo.maven.apache.org/maven2/io/github/software-hardware-codesign/ | ||
runs-on: ${{ matrix.os }} | ||
needs: [compile-assemble] | ||
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-19 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
|
||
- 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/avrsandbox.pub | ||
|
||
- name: Import secret-key | ||
run: gpg --allow-secret-key-import --import --batch --yes --passphrase="avrsandbox" ./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 'avrsandbox' | ||
# sends the public key to a maven compatible host | ||
run: gpg --keyserver keyserver.ubuntu.com --send-keys 85A57D4975B6EE2B6D0EA46903DE10B9F12F0B20 | ||
|
||
- name: Download articular-es build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: articular-build | ||
path: articular-es/build/libs/ | ||
|
||
- name: Deploying articular-es 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 |
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,94 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Build and Test Articular-ES | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "master" branch | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-articular: | ||
# runner images with architectures (variants) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-latest' ] | ||
name: Build jector | ||
|
||
# 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-JDK-19 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
|
||
- name: Compiling articular-es | ||
run: ./gradlew --console="verbose" :articular-es:build | ||
|
||
- name: Archive articular-es | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: articular-es-snapshot | ||
path: articular-es/build/libs/ | ||
|
||
# test-doc-generation: | ||
# # a linux runner image with the ndk installed and llvm ready to compile android native binaries | ||
# runs-on: ${{ matrix.os }} | ||
# strategy: | ||
# matrix: | ||
# os: [ 'ubuntu-latest' ] | ||
# name: Generating documentation | ||
# | ||
# # 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: 'temurin' | ||
# java-version: '19' | ||
# | ||
# - name: Generate javadoc for articular-es | ||
# run: chmod +rwx ./gradlew && ./gradlew :articular-es:generateJavadocJar | ||
|
||
test: | ||
# runner images with architectures (variants) | ||
runs-on: ${{ matrix.os }} | ||
needs: build-jector | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] | ||
name: Testing jector on ${{ matrix.os }} for x86-64 | ||
|
||
# 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-JDK-19 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
|
||
- name: Download articular-es-SNAPSHOT.jar library | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: articular-es-snapshot | ||
path: articular-es/build/libs/ | ||
|
||
- name: Run articular-es example | ||
run: ./gradlew :articular-examples:run |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version=SNAPSHOT |
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,19 @@ | ||
#!/bin/bash | ||
|
||
function getMd5Checksum() { | ||
local input=$1 | ||
local output=$2 | ||
|
||
md5sum "$input" > "$output" | ||
|
||
return $? | ||
} | ||
|
||
function getSha1Checksum() { | ||
local input=$1 | ||
local output=$2 | ||
|
||
sha1sum "$input" > "$output" | ||
|
||
return $? | ||
} |
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,10 @@ | ||
#!/bin/bash | ||
|
||
function move() { | ||
local src=$1 | ||
local dest=$2 | ||
|
||
mv -uv $src $dest | ||
|
||
return $? | ||
} |
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,71 @@ | ||
#!/bin/bash | ||
|
||
function generateGenericPom() { | ||
local groupId=$1 | ||
local artifactId=$2 | ||
local version=$3 | ||
local name=$4 | ||
local description=$5 | ||
local url=$6 | ||
local license_name=$7 | ||
local license_url=$8 | ||
local developer_name=$9 | ||
local developer_mail=${10} | ||
local organization_name=${11} | ||
local organization_url=${12} | ||
local scm_conn=${13} | ||
local output=${14} | ||
|
||
config="<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\"> \ | ||
<modelVersion>4.0.0</modelVersion> \ | ||
<groupId>${groupId}</groupId> \ | ||
<artifactId>${artifactId}</artifactId> \ | ||
<version>${version}</version> \ | ||
<name>${name}</name> \ | ||
<packaging>jar</packaging> \ | ||
<description>${description}</description> \ | ||
<url>${url}</url> \ | ||
<licenses> \ | ||
<license> \ | ||
<name>${license_name}</name> \ | ||
<url>${license_url}</url> \ | ||
</license> \ | ||
</licenses> \ | ||
<developers> \ | ||
<developer> \ | ||
<name>${developer_name}</name> \ | ||
<email>${developer_mail}</email> \ | ||
<organization>${organization_name}</organization> \ | ||
<organizationUrl>${organization_url}</organizationUrl> \ | ||
</developer> \ | ||
</developers> \ | ||
<scm> \ | ||
<connection>${scm_conn}</connection> \ | ||
<developerConnection>${scm_conn}</developerConnection> \ | ||
<url>${url}</url> \ | ||
</scm> \ | ||
</project> \ | ||
" | ||
echo $config > ${output} | ||
} | ||
|
||
function publishBuild() { | ||
local artifactId=$1 | ||
local artifact=$2 | ||
local version=$3 | ||
local javadoc_jar=$4 | ||
local sources_jar=$5 | ||
local pomFile=$6 | ||
|
||
${maven_bin} gpg:sign-and-deploy-file -s ${settings} -Durl=${sonatype_url} \ | ||
-DartifactId=${artifactId} \ | ||
-DrepositoryId=${repository} \ | ||
-Dversion=${version} \ | ||
-DpomFile=${pomFile} \ | ||
-Dgpg.passphrase=${passphrase} \ | ||
-Dfile=${artifact} \ | ||
-Djavadoc=${javadoc_jar} \ | ||
-Dsources=${sources_jar} | ||
|
||
return $? | ||
} |
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
helper-scripts/project-impl/publishing/install-maven-latest.sh
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,16 @@ | ||
#!/bin/bash | ||
|
||
source "./helper-scripts/project-impl/variables.sh" | ||
|
||
function downloadMavenLatest() { | ||
wget "https://dlcdn.apache.org/maven/maven-3/${maven_version}/binaries/apache-maven-${maven_version}-bin.tar.gz" | ||
return $? | ||
} | ||
|
||
function extractMavenLatest() { | ||
tar xzvf "./apache-maven-${maven_version}-bin.tar.gz" | ||
return $? | ||
} | ||
|
||
downloadMavenLatest | ||
extractMavenLatest |
Oops, something went wrong.