Skip to content

Nightly Release - Build #8

Nightly Release - Build

Nightly Release - Build #8

Workflow file for this run

---
name: Nightly Release - Build
on:
workflow_call:
inputs:
branch:
type: string
required: true
nightly:
type: boolean
required: true
secrets:
token:
required: false
registry:
required: false
registry_user:
required: false
registry_password:
required: false
outputs:
image_tag:
description: GHCR.io image tag for downstream consumption
value: ${{ jobs.release.outputs.image_tag }}
workflow_dispatch:
inputs:
branch:
type: choice
required: true
description: Which Branch to make the build from
options:
- main
nightly:
type: boolean
required: true
description: Is this part of a "nightly" workflow?
default: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
outputs:
image_tag: ${{steps.build_image.image_tag}}
steps:
- name: checkout code
uses: actions/[email protected]
with:
ref: ${{inputs.branch}}
- name: Clean Runner
uses: ./.github/actions/clean-runner
- name: setup java
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Set version
if: inputs.nightly == true
run: echo "VERSION=${{inputs.branch}}-nightly" >> $GITHUB_ENV
- name: Set version
if: inputs.nightly == false
run: echo "VERSION=${{inputs.branch}}" >> $GITHUB_ENV
- name: show version
run: echo ${VERSION}
- name: Start Database
uses: ./.github/actions/start-database
- name: Generate Bundle (docs and schemas)
working-directory: schema
run: ant bundle -Dbuilduser.overrides=build/overrides.external.xml -Doracle.image=gvenzl/oracle-free:23.4-full-faststart
- name: Create GitHub Release
id: create_release
uses: softprops/[email protected]
with:
files: |
schema/build/docs.zip
schema/build/resources.jar
schema/build/xmlSchema.zip
tag_name: ${{env.VERSION}}
generate_release_notes: true
token: ${{ secrets.token != null && secrets.token || secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
id: login-ghcr
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.token != null && secrets.token || secrets.GITHUB_TOKEN }}
# #- name: Login to HEC Public Registry
# uses: docker/[email protected]
# id: login-hec
# with:
# registry: ${{ secrets.registry != null && secrets.registry ||secrets.HEC_PUB_REGISTRY }}
# username: ${{ secrets.registry_user != null && secrets.registry_user || secrets.ALT_REG_USER }}
# password: ${{ secrets.registry_password != null && secrets.registry_password || secrets.ALT_REG_PASSWORD }}
- name: Build docker image
id: build_image
env:
IMAGE_TAG: ${{env.VERSION}}
#ALT_REGISTRY: ${{secrets.ALT_REGISTRY}}
#HEC_PUB_REGISTRY: ${{secrets.HEC_PUB_REGISTRY}}
working-directory: schema
run: |
#HEC_PUB_REGISTRY="${{secrets.registry != null && secrets.registry ||secrets.HEC_PUB_REGISTRY}}"
REPO=`echo "${{github.repository}}" | tr '[:upper:]' '[:lower:]'`
ant docker.push -Dteamcity.branch=$VERSION \
-Ddocker.registry=ghcr.io/$REPO \
-Ddocker.registry_public=ghcr.io/$REPO
#- name: Logout of HEC pub registry
# if: ${{ always() }}
# run: |
# docker logout ${{ steps.login-hec.outputs.registry }}
- name: Logout of GH registry
if: ${{ always() }}
run: |
docker logout ${{ steps.login-ghcr.outputs.registry }}