Build arm64 container (#17)

Got arm64 container working on m1 macbook
pull/19/head
Michael Barry 2021-11-06 17:11:12 -04:00 zatwierdzone przez GitHub
rodzic eb72bf1c30
commit 058442188c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
8 zmienionych plików z 50 dodań i 37 usunięć

Wyświetl plik

@ -57,12 +57,6 @@ jobs:
- run: mv flatmap-dist/target/*with-deps.jar flatmap.jar
- run: sha256sum flatmap.jar > flatmap.jar.sha256
- run: md5sum flatmap.jar > flatmap.jar.md5
- name: Log in to the Container Registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install GPG Private Key
run: |
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
@ -78,6 +72,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: ./scripts/push-release.sh ${{ github.event.inputs.version }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAGS: ${{ github.event.inputs.image_tags }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}

Wyświetl plik

@ -33,17 +33,12 @@ jobs:
server-password: MAVEN_PASSWORD
- run: ./scripts/build-release.sh
- run: ./scripts/test-release.sh
- name: Log in to the Container Registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install GPG Private Key
run: |
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
- run: ./scripts/push-release.sh
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAGS: ${{ github.event.inputs.image_tags }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}

1
.gitignore vendored
Wyświetl plik

@ -10,7 +10,6 @@ target/
*.iml
!.idea/codeStyles
!.idea/vcs.xml
!.idea/saveactions_settings.xml
TODO

Wyświetl plik

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SaveActionSettings">
<option name="actions">
<set>
<option value="activate" />
<option value="organizeImports" />
<option value="reformat" />
</set>
</option>
<option name="configurationPath" value="" />
</component>
</project>

Wyświetl plik

@ -20,6 +20,8 @@ To edit the code:
select: `File -> Invalidate Caches... -> Just Restart`.
- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 16 or later
installed on your system
- Recommended: Under `Preferences -> Tools -> Actions on Save` select `Reformat code` and `Optimize imports` to
automatically format code on save.
- To verify everything works correctly, right click on `flatmap-core/src/test/java` folder and click `Run 'All Tests'`
Any pull request should:

Wyświetl plik

@ -17,6 +17,8 @@
<image.version>${project.version}</image.version>
<image>ghcr.io/onthegomap/flatmap:${image.version}</image>
<assembly-phase>package</assembly-phase>
<jib.platform-arch>amd64</jib.platform-arch>
<jib.platform-os>linux</jib.platform-os>
</properties>
<dependencies>
@ -46,10 +48,15 @@
<configuration>
<skip>false</skip>
<from>
<!-- eclipse-temurin:16-jdk - fixed hash for build reproducibility -->
<image>
eclipse-temurin@sha256:e732d05ea997f62908b16ec7b47513ebc56ff74a0b689e9ca5683f911779b40e
eclipse-temurin:17-jdk
</image>
<platforms>
<platform>
<architecture>${jib.platform-arch}</architecture>
<os>${jib.platform-os}</os>
</platform>
</platforms>
</from>
<to>
<image>${image}</image>
@ -121,5 +128,30 @@
<assembly-phase>none</assembly-phase>
</properties>
</profile>
<profile>
<id>jib-multi-arch</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<platforms>
<platform>
<architecture>amd64</architecture>
<os>linux</os>
</platform>
<platform>
<architecture>arm64</architecture>
<os>linux</os>
</platform>
</platforms>
</from>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

Wyświetl plik

@ -32,6 +32,8 @@ public class Main {
);
public static void main(String[] args) throws Exception {
// for some reason the container distribution sometimes exits immediately unless this method prints something
System.out.println("");
EntryPoint task = DEFAULT_TASK;
if (args.length > 0) {

Wyświetl plik

@ -1,16 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
version="${1:-$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)}"
VERSION="${1:-$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)}"
docker image push ghcr.io/onthegomap/flatmap:"${version}"
TAGS=""
if [ -n "${IMAGE_TAGS:-}" ]; then
TAGS="-Djib.to.tags=${IMAGE_TAGS// /}"
fi
TAGS="${IMAGE_TAGS:-}"
for TAG in ${TAGS//,/ }
do
echo "Pushing tag ${TAG}"
docker image tag ghcr.io/onthegomap/flatmap:"${version}" ghcr.io/onthegomap/flatmap:"${TAG}"
docker image push ghcr.io/onthegomap/flatmap:"${TAG}"
done
./mvnw -B -ntp -DskipTests "${TAGS}" -Pjib-multi-arch \
-Dimage.version="${VERSION}" \
-Djib.to.auth.username="${GITHUB_ACTOR}" \
-Djib.to.auth.password="${GITHUB_TOKEN}" \
package jib:build --file pom.xml
./mvnw -B -Dgpg.passphrase="${OSSRH_GPG_SECRET_KEY_PASSWORD}" -DskipTests -Prelease deploy