Skip to content

Commit

Permalink
Release: com.io7m.idstore 2.0.0
Browse files Browse the repository at this point in the history
Change: Update com.io7m.quixote:com.io7m.quixote.core:1.2.0 → 1.3.0.
Change: Update com.io7m.verdant.version:1.0.0 → 1.0.1.
Change: Update com.io7m.canonmill:com.io7m.canonmill.core:2.0.1 → 2.1.0.
Change: Update com.io7m.jxtrand.version:2.0.0 → 2.1.0.
Change: Update io.opentelemetry:opentelemetry-bom:1.37.0 → 1.38.0.
Change: Update com.io7m.blackthorne.version:2.0.0 → 2.0.1.
Change: Update io.opentelemetry:opentelemetry-sdk-logs:1.37.0 → 1.38.0.
Change: Update org.mockito:mockito-core:5.11.0 → 5.12.0.
Change: Update com.io7m.jmulticlose:com.io7m.jmulticlose.core:1.1.2 → 1.1.3.
Change: Update com.io7m.repetoir:com.io7m.repetoir.core:1.0.0 → 1.0.1.
Change: Update com.io7m.jbssio.version:2.0.0 → 2.1.0.
Change: (Backwards incompatible) Upgrade to hibiscus 1.0.0-beta0001.
Change: Update ch.qos.logback.version:1.5.4 → 1.5.5.
Change: Update org.slf4j.version:2.0.12 → 2.0.13.
Change: Update org.codehaus.mojo:jaxb2-maven-plugin:3.1.0 → 3.2.0.
Change: Update org.apache.commons:commons-text:1.11.0 → 1.12.0.
Change: Update ch.qos.logback.version:1.5.5 → 1.5.6.
Change: Update io.helidon:helidon-bom:4.0.7 → 4.0.8.
Change: Update net.bytebuddy.version:1.14.13 → 1.14.14.
Change: Update com.io7m.ervilla.version:1.0.0-beta0002 → 1.0.0.
Change: Update com.io7m.quarrel.version:1.6.0 → 1.6.1.
Change: Update com.io7m.jade.version:1.0.2 → 1.0.3.
Change: Update com.io7m.anethum.version:1.1.0 → 1.1.1.
Change: Update com.io7m.jlexing:com.io7m.jlexing.core:3.1.0 → 3.2.0.
Change: Update com.io7m.seltzer:com.io7m.seltzer.api:1.0.0 → 1.0.1.
Change: Update net.bytebuddy.version:1.14.14 → 1.14.15.
Change: Update org.jetbrains.kotlin:kotlin-stdlib:1.9.23 → 1.9.24.
Change: Update com.io7m.jxe:com.io7m.jxe.core:1.0.2 → 1.0.3.
Change: Update com.io7m.jdeferthrow:com.io7m.jdeferthrow.core:1.2.0 → 1.3.0.
Change: Update com.io7m.jaffirm:com.io7m.jaffirm.core:4.0.0 → 4.0.1.
Change: Update org.jooq.version:3.19.7 → 3.19.8.
Change: Update io.opentelemetry:opentelemetry-sdk-logs:1.36.0 → 1.37.0
Change: Update io.opentelemetry:opentelemetry-bom:1.36.0 → 1.37.0
Change: Update ch.qos.logback:logback-classic:1.5.3 → 1.5.4
Change: Update ch.qos.logback:logback-core:1.5.3 → 1.5.4
Change: Update commons-io:commons-io:2.16.0 → 2.16.1
  • Loading branch information
io7m committed May 11, 2024
2 parents e3eeb11 + 6c8fd32 commit e00ac63
Show file tree
Hide file tree
Showing 70 changed files with 850 additions and 136 deletions.
14 changes: 7 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"

target-branch: "develop"

# Update all dependencies, but don't try to do any major updates.
groups:
all:
patterns:
- "*"
ignore:
- dependency-name: "*"
update-types: [ "version-update:semver-major" ]
162 changes: 162 additions & 0 deletions .github/workflows/Tools.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
* Copyright © 2024 Mark Raynsford <[email protected]> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.TreeMap;

public final class Tools
{
private static final TreeMap<String, OpType> OPS =
new TreeMap<>();

static {
final var opsList = List.of(
new ShowProjectVersion(),
new ShowProjectIsSnapshot()
);

for (final var op : opsList) {
OPS.put(op.name(), op);
}
}

private Tools()
{

}

private interface OpType
{
String name();

void execute(String[] args)
throws Exception;
}

private static String getProjectVersion(
final File file)
throws Exception
{
final var documentBuilders =
DocumentBuilderFactory.newInstance();
final var documentBuilder =
documentBuilders.newDocumentBuilder();
final var document =
documentBuilder.parse(file);

final var xPathFactory =
XPathFactory.newInstance();
final var xPath =
xPathFactory.newXPath();

final var nodes =
(NodeList) xPath.evaluate(
"//project/version",
document,
XPathConstants.NODESET
);

for (var i = 0; i < nodes.getLength(); i++) {
final var node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
return node.getTextContent().trim();
}
}

throw new IOException(
"Could not locate a //project/version node!"
);
}

private static final class ShowProjectVersion implements OpType
{
ShowProjectVersion()
{

}

@Override
public String name()
{
return "ShowProjectVersion";
}

@Override
public void execute(
final String[] args)
throws Exception
{
System.out.print("IO7M_PROJECT_VERSION=");
System.out.println(getProjectVersion(new File(args[1])));
}
}

private static final class ShowProjectIsSnapshot implements OpType
{
ShowProjectIsSnapshot()
{

}

@Override
public String name()
{
return "ShowProjectIsSnapshot";
}

@Override
public void execute(
final String[] args)
throws Exception
{
System.out.print("IO7M_PROJECT_VERSION_IS_SNAPSHOT=");
System.out.println(
getProjectVersion(new File(args[1])).endsWith("-SNAPSHOT")
);
}
}

public static void main(
final String[] args)
throws Exception
{
if (args.length == 0) {
System.err.println("Usage: command");
System.exit(1);
}

final var op = OPS.get(args[0]);
if (op == null) {
System.err.println("Unrecognized command.");
System.err.println(" Must be one of:");
for (final var name : OPS.keySet()) {
System.err.print(" ");
System.err.println(name);
}
System.exit(1);
}

op.execute(args);
}
}
58 changes: 58 additions & 0 deletions .github/workflows/deploy-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/sh

fatal()
{
echo "fatal: $1" 1>&2
exit 1
}

if [ -z "${MAVEN_CENTRAL_USERNAME}" ]
then
fatal "MAVEN_CENTRAL_USERNAME is not set."
fi

if [ -z "${MAVEN_CENTRAL_PASSWORD}" ]
then
fatal "MAVEN_CENTRAL_PASSWORD is not set."
fi

(cat <<EOF
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>io7m</id>
<properties>
<gpg.useagent>true</gpg.useagent>
<gpg.keyname>github-ci-maven-rsa-key</gpg.keyname>
<io7m.deployment>true</io7m.deployment>
</properties>
</profile>
</profiles>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${MAVEN_CENTRAL_USERNAME}</username>
<password>${MAVEN_CENTRAL_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${MAVEN_CENTRAL_USERNAME}</username>
<password>${MAVEN_CENTRAL_PASSWORD}</password>
</server>
</servers>
</settings>
EOF
) > "$HOME/.m2/settings.xml" || fatal "could not update $HOME/.m2/settings.xml"

exec mvn \
-Dio7m.release=true \
-Dio7m.deployment=true \
--batch-mode \
--strict-checksums \
-DskipTests=true \
-DskipITs=true deploy
50 changes: 50 additions & 0 deletions .github/workflows/deploy-snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh

fatal()
{
echo "fatal: $1" 1>&2
exit 1
}

if [ -z "${MAVEN_CENTRAL_USERNAME}" ]
then
fatal "MAVEN_CENTRAL_USERNAME is not set."
fi

if [ -z "${MAVEN_CENTRAL_PASSWORD}" ]
then
fatal "MAVEN_CENTRAL_PASSWORD is not set."
fi

(cat <<EOF
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- Enable deployment of OCI images. -->
<activeProfiles>
<activeProfile>io7m-oci-image</activeProfile>
</activeProfiles>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${MAVEN_CENTRAL_USERNAME}</username>
<password>${MAVEN_CENTRAL_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${MAVEN_CENTRAL_USERNAME}</username>
<password>${MAVEN_CENTRAL_PASSWORD}</password>
</server>
</servers>
</settings>
EOF
) > "$HOME/.m2/settings.xml" || fatal "could not update $HOME/.m2/settings.xml"

exec mvn \
--batch-mode \
--strict-checksums \
-DskipTests=true \
-DskipITs=true deploy
39 changes: 39 additions & 0 deletions .github/workflows/deploy.linux.temurin.lts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

name: deploy.linux.temurin.lts

on:
push:
tags: [ com.io7m.idstore-* ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin

- name: Import signing key
env:
PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }}
run: echo "${PGP_SIGNING_KEY}" | gpg --import

- name: Log in to Quay.io.
uses: redhat-actions/[email protected]
with:
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
registry: 'quay.io'

- name: Deploy release
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
run: .github/workflows/deploy-release.sh

27 changes: 21 additions & 6 deletions .github/workflows/main.linux.temurin.current.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@

name: main.linux.temurin.current

on:
push:
branches: [ develop, feature/*, release/* ]
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- name: JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'temurin'

- name: Collect project version
id: project_version
run: java .github/workflows/Tools.java ShowProjectVersion pom.xml >> "$GITHUB_OUTPUT"

- name: Collect project snapshot
id: project_is_snapshot
run: java .github/workflows/Tools.java ShowProjectIsSnapshot pom.xml >> "$GITHUB_OUTPUT"

- name: Build
run: mvn --errors clean verify site
run: mvn --batch-mode --strict-checksums --errors clean verify site

- name: Upload test logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: test-logs
path: ./com.io7m.idstore.tests/target/surefire-reports



Loading

0 comments on commit e00ac63

Please sign in to comment.