Skip to content

Commit

Permalink
NOISSUE starting setup to switch from travis ci to git runners
Browse files Browse the repository at this point in the history
  • Loading branch information
mheil committed Mar 21, 2024
1 parent 317be78 commit 6447965
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 79 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: deploy snapshot

on:
push:
branches:
- develop

jobs:
deploy-snapshot:

runs-on: ubuntu-latest

steps:
# Checkout source code
- name: Checkout
uses: actions/checkout@v2
# Setup Java environment
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Run maven verify
- name: Maven verify
run: mvn verify --batch-mode
# Publish
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USER }}
nexus_password: ${{ secrets.OSSRH_PASSWORD }}
64 changes: 64 additions & 0 deletions .github/workflows/release-and-deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: release and deploy

on:
push:
branches:
- master

jobs:
release:

runs-on: ubuntu-latest

steps:
# Checkout source code
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: '0'
# Setup Java environment
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Install xmllint
- name: Install dependencies
run: sudo apt-get install libxml2-utils
# Set git username and email
- name: Set up Git
run: |
chmod +x ci/setup-git.sh
ci/setup-git.sh
# Release, set correct versions and create tag
- name: Release (versioning/tag)
run: |
chmod +x ci/mvn-release.sh
ci/mvn-release.sh
deploy-release:

needs: release
runs-on: ubuntu-latest

steps:
# Checkout source code
- name: Checkout
uses: actions/checkout@v2
with:
ref: 'master'
# Setup Java environment
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Run maven verify
- name: Maven verify
run: mvn verify --batch-mode
# Publish
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.OSSRH_USER }}
nexus_password: ${{ secrets.OSSRH_PASSWORD }}
25 changes: 25 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: verify

on:
push:
branches-ignore:
- develop
- master

jobs:
verify:

runs-on: ubuntu-latest

steps:
# Checkout source code
- name: Checkout
uses: actions/checkout@v2
# Setup Java environment
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Run maven verify
- name: Maven verify
run: mvn verify --batch-mode
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Generic Multifield for AEMaaCS

System | Status
--------------|------------------------------------------------
Dependency | [![Maven Central][maven-central-version]][maven-central]
| System | Status |
|------------|------------------------------------------------------------------------------------------------------|
| CI master | ![release](https://github.com/merkle-open/aem-generic-multifield/workflows/release%20and%20deploy/badge.svg) |
| CI develop | ![snapshot](https://github.com/merkle-open/aem-generic-multifield/workflows/deploy%20snapshot/badge.svg) |
| Dependency | [![Maven Central][maven-central-version]][maven-central] |

With this project you can use a widget in [AEM as a Cloud Service](https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/release-notes/home.html) Touch UI which lets you create a generic multifield in a dialog.

Expand All @@ -19,7 +21,7 @@ With this project you can use a widget in [AEM as a Cloud Service](https://exper

### in AEM
Since the Generic Multifield is built as an OSGi bundle, only the bundle has to be installed into your AEM instance.
With the common AEM archetype it can be added within the embedded configuration of the "content-package-maven-plugin" plugin.
With the common AEM archetype it can be added within the embedded configuration of the `content-package-maven-plugin` plugin.
```xml
<plugin>
<groupId>com.day.jcr.vault</groupId>
Expand All @@ -40,7 +42,7 @@ With the common AEM archetype it can be added within the embedded configuration


#### Component Dialog
Example usage of the Generic Multifield in your component _cq_dialog.xml definition within AEM (Touch UI):
Example usage of the Generic Multifield in your component `_cq_dialog.xml` definition within AEM:
```xml
<!-- Within the component dialog definition -->
<jcr:root
Expand Down Expand Up @@ -75,6 +77,7 @@ Example usage of the Generic Multifield in your component _cq_dialog.xml definit
![main dialog](docs/component.png)

#### Item-Dialog
Example definition of the Generic Multifield item in your component's `item-dialog.xml` referenced within `<genericmultifield>` definition via property `itemDialog`:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
Expand Down
33 changes: 33 additions & 0 deletions ci/mvn-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

function getVersion() {
xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml
}

CURRENT_VERSION=$(getVersion)
if [[ $CURRENT_VERSION == *-SNAPSHOT ]]; then
echo "perform release"
mvn versions:set -DremoveSnapshot versions:commit --no-transfer-progress
NEW_VERSION=$(getVersion)

echo "commit new release version"
git commit -a -m "Release $NEW_VERSION: set master to new release version"

echo "Update version in README.md"
sed -i -e "s|<version>[0-9A-Za-z._-]\{1,\}</version>|<version>$NEW_VERSION</version>|g" README.md && rm -f README.md-e
git commit -a -m "Release $NEW_VERSION: Update README.md"

echo "create tag for new release"
git tag -a $NEW_VERSION -m "Release $NEW_VERSION: tag release"

echo "update develop version"
git fetch --all
git checkout develop
mvn versions:set -DnextSnapshot versions:commit --no-transfer-progress
NEXT_SNAPSHOT=$(getVersion)
echo "commit new snapshot version"
git commit -a -m "Release $NEW_VERSION: set develop to next development version $NEXT_SNAPSHOT"

git push --all
git push --tags
fi
4 changes: 4 additions & 0 deletions ci/setup-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

git config --global user.email "oss@namics.com"
git config --global user.name "Namics OSS CI"
Binary file removed codesigning.asc.enc
Binary file not shown.
23 changes: 0 additions & 23 deletions mvnsettings.xml

This file was deleted.

72 changes: 60 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.namics.oss.aem</groupId>
<artifactId>genericmultifield</artifactId>
Expand All @@ -20,6 +19,24 @@
</license>
</licenses>

<properties>
<!-- Maven Plugins -->
<mvn.source.plugin.version>3.3.0</mvn.source.plugin.version>
<mvn.javadoc.version>3.5.0</mvn.javadoc.version>
<mvn.gpg.plugin.version>3.0.1</mvn.gpg.plugin.version>
<mvn.nexus-staging.plugin.version>1.6.13</mvn.nexus-staging.plugin.version>

<maven.build.timestamp.format>yyyy-MM-dd-z-HH-mm-ss</maven.build.timestamp.format>
<git.build.time>${maven.build.timestamp}</git.build.time>
<git.branch>unknown</git.branch>
<git.commit.id>unknown</git.commit.id>
<git.commit.time>unknown</git.commit.time>
<java.version>11</java.version>
<encoding>UTF-8</encoding>
<project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<repositories>
<repository>
<id>adobe-public-releases</id>
Expand Down Expand Up @@ -72,7 +89,6 @@
</plugins>
</build>


<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand All @@ -90,7 +106,6 @@
<developerConnection>scm:git:git@github.com:merkle-open/aem-generic-multifield.git</developerConnection>
</scm>


<profiles>
<profile>
<id>autoInstallBundle</id>
Expand All @@ -112,27 +127,63 @@
</build>
</profile>
<profile>
<id>ossrh</id>
<id>deploy</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${mvn.source.plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${mvn.javadoc.version}</version>
<configuration>
<failOnError>false</failOnError>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>${mvn.gpg.plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>${mvn.nexus-staging.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -153,7 +204,4 @@
</build>
</profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
org.apache.sling.api.wrappers.ValueMapDecorator,
java.util.HashMap" %>
<%
ValueMap vm = new ValueMapDecorator(new HashMap<String, Object>());
final ValueMap vm = new ValueMapDecorator(new HashMap<String, Object>());
// set non-empty string, otherwise the read only rendering will not work
vm.put("value", "-");
Expand Down
Loading

0 comments on commit 6447965

Please sign in to comment.