Skip to content

Commit

Permalink
build: attempt to create both adm64 and arm64 docker files
Browse files Browse the repository at this point in the history
Switched from RedHat to Azul JDK images.
  • Loading branch information
novoj committed Dec 26, 2023
1 parent 75fefea commit 5dfe7c9
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
67 changes: 66 additions & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,29 @@ concurrency:

jobs:
build:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
outputs:
release_id: ${{ steps.create_release.outputs.id }}
released_version: ${{ steps.release_version.outputs.version }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3 # checkout sources

- name: Resolve new release version
id: release_version
uses: codacy/git-version@2.7.1
with:
prefix: 'v'
minor-identifier: 'feat'
major-identifier: '(breaking)' # this should be placed somewhere in the commit message like "feat: (breaking) some message"

- name: Setup Java JDK
uses: actions/setup-java@v3 # setup JDK 17 for building
with:
Expand All @@ -36,12 +54,59 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Build with Maven # run Maven without tests (tests must pass in dev branch)
run: mvn -T 1C -B deploy -Dmaven.test.skip=true --file pom.xml
run: |
mvn versions:set -DnewVersion=${{ steps.release_version.outputs.version }}
mvn -T 1C -B deploy -Dmaven.test.skip=true --file pom.xml
env:
EVITA_BUILD_VERSION: ${{ steps.release_version.outputs.version }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Create distribution directory
run: |
mkdir -p ./dist
cp LICENSE ./dist
cp 'evita_server/target/evita-server.jar' ./dist
cp 'docker/entrypoint.sh' './dist/run.sh'
- name: Create .zip of dist
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
filename: 'dist.zip'
path: './dist'

- name: Create .tar.gz of dist
uses: thedoctor0/zip-release@0.7.1
with:
type: 'tar'
filename: 'dist.tar.gz'
path: './dist'

- name: Create release
id: create_release
uses: release-drafter/release-drafter@v5
with:
version: ${{ steps.release_version.outputs.version }}
publish: true

- name: Upload dist.zip to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: Dist (zip)
asset_content_type: application/zip

- name: Upload dist.tar.gz to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.tar.gz
asset_name: Dist (tar.gz)
asset_content_type: application/gzip

- name: Upload evitaDB server artifact # upload `evita-server.jar` for `docker-latest.yml` to deploy to DockerHub
uses: actions/upload-artifact@v2
if: success()
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ USER root
RUN set -ex \
&& mkdir "$EVITA_HOME" "$EVITA_HOME/bin" "$EVITA_HOME/conf" "$EVITA_HOME/data" "$EVITA_HOME/certificates" \
&& : ## end
COPY "entrypoint.sh" "/"
COPY "entrypoint.sh" "$EVITA_HOME"
COPY "$EVITA_JAR_NAME" "$EVITA_HOME/bin"
COPY "evita-configuration.yaml" "$EVITA_HOME/conf"

Expand All @@ -23,5 +23,5 @@ ENV EVITA_JAVA_OPTS=""
ENV EVITA_ARGS=""

WORKDIR "$EVITA_HOME"
ENTRYPOINT [ "/entrypoint.sh" ]
ENTRYPOINT [ "/$EVITA_HOME/entrypoint.sh" ]
CMD []

0 comments on commit 5dfe7c9

Please sign in to comment.