-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (86 loc) · 3.66 KB
/
nightly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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
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.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: [ { repo: "runtime-metamodel", workflowfile: "ci.yaml" },
{ repo: "gradleplugins", workflowfile: "test.yaml" },
{ repo: "connector", workflowfile: "verify.yaml" },
{ repo: "identityhub", workflowfile: "verify.yaml" },
{ repo: "registrationservice", workflowfile: "verify.yaml" },
{ repo: "federatedcatalog", workflowfile: "verify.yaml" },
{ repo: "technology-azure", workflowfile: "verify.yaml" },
{ repo: "technology-aws", workflowfile: "verify.yaml" },
{ 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 "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 ]
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
name: "Invoke discord webhook"
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_GITHUB }}
title: "Nightly Build"
description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}"
username: GitHub Actions