1.0.7 #12
Workflow file for this 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 workflow will build a Java project with Gradle | |
# This file was contributed by ysenih@erpya.com from ERP Consultores y Asociados, C.A | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Publish Project | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
# Build dist application adempiere-middleware | |
build-app: | |
name: Build dist adempiere-zk | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up Java JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-package: 'jdk' | |
java-version: 11 | |
architecture: x64 | |
- name: Set Main Version | |
run: echo "MAIN_VERSION=${{ github.event.release.name }}" >> client/src/main/java/org/adempiere/version.properties | |
- name: Set Release Date | |
run: echo "DATE_VERSION=$(date +'%Y-%m-%d')" >> client/src/main/java/org/adempiere/version.properties | |
- name: Set Implementation Version | |
run: echo "IMPLEMENTATION_VERSION=${{ github.event.release.tag_name }}" >> client/src/main/java/org/adempiere/version.properties | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: 8.0.2 | |
arguments: createRelease | |
env: | |
GITHUB_DEPLOY_USER: ${{ github.actor }} | |
GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} | |
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }} | |
- name: Upload dist app zip artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zk-ui.zip | |
path: build/release/zk-ui.zip | |
- name: Upload dist app zip.MD5 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zk-ui.zip.MD5 | |
path: build/release/zk-ui.zip.MD5 | |
- name: Upload dist app tar artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zk-ui.tar | |
path: build/release/zk-ui.tar | |
- name: Upload dist app tar.MD5 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zk-ui.tar.MD5 | |
path: build/release/zk-ui.tar.MD5 | |
- name: Upload dist app tar artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zk-ui.war | |
path: build/release/zk-ui.war | |
- name: Upload dist app war.MD5 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zk-ui.war.MD5 | |
path: build/release/zk-ui.war.MD5 | |
publish-binaries: | |
name: Upload Binaries adempiere-zk | |
needs: build-app | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
- name: Upload zip | |
uses: skx/github-action-publish-binaries@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: zk-ui.zip/zk-ui.zip | |
- name: Upload zip.MD5 | |
uses: skx/github-action-publish-binaries@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: zk-ui.zip.MD5/zk-ui.zip.MD5 | |
- name: Upload tar | |
uses: skx/github-action-publish-binaries@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: zk-ui.tar/zk-ui.tar | |
- name: Upload tar.MD5 | |
uses: skx/github-action-publish-binaries@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: zk-ui.tar.MD5/zk-ui.tar.MD5 | |
- name: Upload war | |
uses: skx/github-action-publish-binaries@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: zk-ui.war/zk-ui.war | |
- name: Upload war.MD5 | |
uses: skx/github-action-publish-binaries@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: zk-ui.war.MD5/zk-ui.war.MD5 | |
# Check secrets to push image in docker hub registry | |
check-docker-secrets: | |
name: Check if docker hub registry information was set on secrets | |
needs: | |
- build-app | |
runs-on: ubuntu-latest | |
outputs: | |
is_have_secrets: ${{ steps.check_secret_job.outputs.is_have_secrets }} | |
steps: | |
- id: check_secret_job | |
run: | | |
if [[ "${{ secrets.DOCKER_REPO_ADEMPIERE_ZK }}" != "" && \ | |
"${{ secrets.DOCKER_USERNAME }}" != "" && \ | |
"${{ secrets.DOCKER_TOKEN }}" != "" ]]; \ | |
then | |
echo "Secrets to use a container registry are configured in the repo" | |
echo "is_have_secrets=true" >> $GITHUB_OUTPUT | |
else | |
echo "Secrets to use a container registry were not configured in the repo" | |
echo "is_have_secrets=false" >> $GITHUB_OUTPUT | |
fi | |
# TODO: Download .tar and add docker image without uncompress | |
# Publish docker alpine image in Docker Hub Registry to application | |
push-alpine-imame-dhr: | |
name: Push Jetty docker alpine image to Docker Hub | |
needs: | |
- check-docker-secrets | |
# Skip step based on secret | |
if: needs.check-docker-secrets.outputs.is_have_secrets == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Download build zip app | |
uses: actions/download-artifact@v3 | |
with: | |
name: zk-ui.zip | |
- name: Download build war app | |
uses: actions/download-artifact@v3 | |
with: | |
name: zk-ui.war | |
- name: Unzip Asset | |
run: | | |
unzip zk-ui.zip -d docker/jetty/ | |
- name: Move war | |
run: mv zk-ui.war docker/jetty/zk-ui/ | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
# CONFIGURE DOCKER SECRETS INTO REPOSITORY | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Push alpine image in Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: docker/jetty/Dockerfile.alpine | |
push: true | |
tags: | | |
${{ secrets.DOCKER_REPO_ADEMPIERE_ZK }}:jetty-alpine-${{ github.event.release.tag_name }} | |
${{ secrets.DOCKER_REPO_ADEMPIERE_ZK }}:jetty-alpine | |
# TODO: Download .tar and add docker image without uncompress | |
# Publish docker multiplatform image in Docker Hub Registry to application | |
push-image-dhr: | |
name: Push Jetty docker multiplatform image to Docker Hub | |
needs: | |
- check-docker-secrets | |
# Skip step based on secret | |
if: needs.check-docker-secrets.outputs.is_have_secrets == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Download build zip app | |
uses: actions/download-artifact@v3 | |
with: | |
name: zk-ui.zip | |
- name: Download build war app | |
uses: actions/download-artifact@v3 | |
with: | |
name: zk-ui.war | |
- name: Unzip Asset | |
run: | | |
unzip zk-ui.zip -d docker/jetty/ | |
- name: Move war | |
run: mv zk-ui.war docker/jetty/zk-ui/ | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
# CONFIGURE DOCKER SECRETS INTO REPOSITORY | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Push image in Docker Hub | |
uses: docker/build-push-action@v4.0.0 | |
with: | |
context: . | |
file: docker/jetty/Dockerfile | |
platforms: linux/amd64,linux/amd64/v2,linux/arm64/v8 | |
push: true | |
tags: | | |
${{ secrets.DOCKER_REPO_ADEMPIERE_ZK }}:jetty-${{ github.event.release.tag_name }} | |
${{ secrets.DOCKER_REPO_ADEMPIERE_ZK }}:jetty |