Build Nightly #5
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
name: Build Nightly | |
on: | |
schedule: | |
- cron: "0 1 * * *" # run at 01:00 UTC | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Semantic Version string to use for this nightly build | |
required: false | |
repo-owner: | |
description: Owner/Org in which the nightly should get created | |
default: "eclipse-edc" | |
env: | |
OWNER: ${{ github.event.inputs.repo-owner || inputs.repo-owner }} | |
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.secret-presence.outputs.HAS_GH_PAT }} | |
steps: | |
- name: Check whether secrets exist | |
id: secret-presence | |
run: | | |
[ ! -z "${{ secrets.ORG_GITHUB_BOT_USER }}" ] && | |
[ ! -z "${{ secrets.ORG_GITHUB_BOT_USER }}" ] && echo "HAS_GH_PAT=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://raw.githubusercontent.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: [ { owner: "${{ github.event.inputs.repo-owner }}", repo: "runtime-metamodel", workflowfile: "ci.yaml" }, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "gradleplugins", workflowfile: "test.yaml" }, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "connector", workflowfile: "verify.yaml"}, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "identityhub", workflowfile: "verify.yaml"}, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "registrationservice", workflowfile: "verify.yaml"}, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "federatedcatalog", workflowfile: "verify.yaml"}, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "technology-azure", workflowfile: "verify.yaml"}, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "technology-aws", workflowfile: "verify.yaml"}, | |
{ owner: "${{ github.event.inputs.repo-owner }}", repo: "technology-gcp", workflowfile: "verify.yaml"} ] | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 "${{ matrix.test-def.owner }}" "${{ 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 | |
secrets: inherit | |
with: | |
version: ${{ needs.Determine-Version.outputs.VERSION }}" |