Skip to content

Build Nightly

Build Nightly #402

Workflow file for this run

name: Build Nightly
on:
schedule:
- cron: "0 0 * * *" # run at 00:00 UTC
workflow_dispatch:
inputs:
version:
description: Semantic Version string to use for this nightly build
required: false
env:
INPUT_VERSION: ${{ github.event.inputs.version || inputs.version }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Secrets-Presence:
name: "Check for required credentials"
runs-on: ubuntu-latest
outputs:
HAS_GH_PAT: ${{ steps.secrets-presence.outputs.HAS_GH_PAT }}
HAS_WEBHOOK: ${{ steps.secrets-presence.outputs.HAS_WEBHOOK }}
steps:
- name: Check whether secrets exist
id: secrets-presence
run: |
[ ! -z "${{ secrets.ORG_GITHUB_BOT_USER }}" ] &&
[ ! -z "${{ secrets.ORG_GITHUB_BOT_TOKEN }}" ] && echo "HAS_GH_PAT=true" >> $GITHUB_OUTPUT
[ ! -z "${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}" ] && echo "HAS_WEBHOOK=true" >> $GITHUB_OUTPUT
exit 0
Determine-Version:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.get-version.outputs.VERSION }}
steps:
- name: "Extract version"
id: get-version
run: |
if [ -z ${{ env.INPUT_VERSION }} ]; then
wget -cq https://github.com/eclipse-edc/Connector/main/gradle.properties
echo "VERSION=$(IFS=.- read -r RELEASE_VERSION_MAJOR RELEASE_VERSION_MINOR RELEASE_VERSION_PATCH SNAPSHOT<<<$(grep "version" gradle.properties | awk -F= '{print $2}') && echo $RELEASE_VERSION_MAJOR.$RELEASE_VERSION_MINOR.$RELEASE_VERSION_PATCH-$(date +"%Y%m%d")-SNAPSHOT)" >> "$GITHUB_OUTPUT"
else
echo "VERSION=${{ env.INPUT_VERSION }}" >> "$GITHUB_OUTPUT"
fi
Run-All-Tests:
name: "Run tests"
runs-on: ubuntu-latest
needs: [ Secrets-Presence, Determine-Version ]
if: |
needs.Secrets-Presence.outputs.HAS_GH_PAT
strategy:
fail-fast: false
matrix:
test-def: [ { repo: "runtime-metamodel", workflowfile: "verify.yaml" },
{ repo: "gradleplugins", workflowfile: "verify.yaml" },
{ repo: "connector", workflowfile: "verify.yaml" },
{ repo: "identityhub", workflowfile: "verify.yaml" },
{ repo: "federatedcatalog", workflowfile: "verify.yaml" }]
steps:
- uses: actions/checkout@v4
- name: "Log version"
run: |
echo "Will build version ${{ needs.Determine-Version.outputs.VERSION }}"
- name: "Run test for ${{ matrix.test-def.repo }}"
run: |
chmod +x ./scripts/github_action.sh
./scripts/github_action.sh "eclipse-edc" "${{ matrix.test-def.repo }}" "${{ matrix.test-def.workflowfile}}" "" "${{ secrets.ORG_GITHUB_BOT_USER }}" "${{ secrets.ORG_GITHUB_BOT_TOKEN }}"
Publish-Components:
needs: [ Determine-Version, Run-All-Tests ]
uses: eclipse-edc/Release/.github/workflows/publish-all-in-one.yaml@main
with:
version: ${{ needs.Determine-Version.outputs.VERSION }}
secrets: inherit
Post-To-Discord:
needs: [ Publish-Components, Determine-Version, Secrets-Presence ]
if: "needs.Secrets-Presence.outputs.HAS_WEBHOOK && always()"
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
name: "Invoke discord webhook"
with:
webhook: ${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}
# if the publishing is skipped, that means the preceding test run failed
status: ${{ needs.Publish-Components.result == 'skipped' && 'Failure' || needs.Publish-Components.result }}
title: "Nightly Build"
description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}"
username: GitHub Actions