diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index 43028ae3d..e0f5ff931 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -209,3 +209,13 @@ jobs: with: downstream-version: ${{ needs.release-version.outputs.RELEASE_VERSION }} secrets: inherit + + publish-openapi-to-gh-pages: + name: "Publish OpenAPI UI spec GitHub Pages" + permissions: + contents: read + needs: [ release-version ] + uses: ./.github/workflows/publish-openapi-ui.yml + secrets: inherit + with: + version: ${{ needs.release-version.outputs.RELEASE_VERSION }} \ No newline at end of file diff --git a/.github/workflows/publish-new-snapshot.yaml b/.github/workflows/publish-new-snapshot.yaml index ce5bb8619..8476cf2f2 100644 --- a/.github/workflows/publish-new-snapshot.yaml +++ b/.github/workflows/publish-new-snapshot.yaml @@ -39,6 +39,8 @@ on: - published workflow_dispatch: + # periodic build triggers are defined in run-all-tests.yml, which triggers this workflow + concurrency: # cancel only running jobs on pull requests @@ -65,34 +67,66 @@ jobs: [ ! -z "${{ secrets.SWAGGERHUB_USER }}" ] && echo "HAS_SWAGGER=true" >> $GITHUB_OUTPUT exit 0 + determine-version: + runs-on: ubuntu-latest + outputs: + VERSION: ${{ steps.get-version.outputs.VERSION }} + steps: + - uses: actions/checkout@v4 + - name: "Get version" + id: get-version + run: | + + # only create the version string if the run-all-tests workflow was triggered by a cron event + + if [[ ${{ github.event.workflow_run.event }} == "schedule" ]]; then + 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" + fi + publish-docker-images: name: "Create Docker Images" - needs: [ secret-presence ] + needs: [ secret-presence, determine-version] if: | needs.secret-presence.outputs.DOCKER_HUB_TOKEN permissions: contents: write uses: ./.github/workflows/trigger-docker-publish.yaml secrets: inherit + with: + docker_tag: ${{ needs.determine-version.outputs.VERSION }} publish-maven-artifacts: name: "Publish artefacts to OSSRH Snapshots / MavenCentral" permissions: contents: read - needs: [ secret-presence ] + needs: [ secret-presence, determine-version ] # do not run on PR branches, do not run on releases if: | needs.secret-presence.outputs.HAS_OSSRH && github.event_name != 'pull_request' && github.ref != 'refs/heads/releases' uses: ./.github/workflows/trigger-maven-publish.yaml secrets: inherit + with: + version: ${{ needs.determine-version.outputs.VERSION }} publish-to-swaggerhub: name: "Publish OpenAPI spec to Swaggerhub" permissions: contents: read - needs: [ secret-presence ] + needs: [ secret-presence, determine-version ] if: needs.secret-presence.outputs.HAS_SWAGGER uses: ./.github/workflows/publish-swaggerhub.yaml secrets: inherit + with: + downstream-version: ${{ needs.determine-version.outputs.VERSION }} + + publish-openapi-to-gh-pages: + name: "Publish OpenAPI UI spec GitHub Pages" + permissions: + contents: read + needs: [ secret-presence, determine-version ] + uses: ./.github/workflows/publish-openapi-ui.yml + secrets: inherit + with: + version: ${{ needs.determine-version.outputs.VERSION }} diff --git a/.github/workflows/publish-openapi-ui.yml b/.github/workflows/publish-openapi-ui.yml index 5d6cf3808..62102ef6f 100644 --- a/.github/workflows/publish-openapi-ui.yml +++ b/.github/workflows/publish-openapi-ui.yml @@ -21,10 +21,6 @@ name: publish openapi ui on: - push: - branches: - - main - - release/* workflow_dispatch: inputs: @@ -33,6 +29,13 @@ on: description: "Version of the Tractus-X EDC API to be should be published" type: string + workflow_call: + inputs: + version: + required: false + description: "Version of the Tractus-X EDC API to be should be published" + type: string + jobs: generate-openapi-spec: runs-on: ubuntu-latest diff --git a/.github/workflows/run-all-tests.yml b/.github/workflows/run-all-tests.yml index 26eacc08a..9b6843b86 100644 --- a/.github/workflows/run-all-tests.yml +++ b/.github/workflows/run-all-tests.yml @@ -37,6 +37,9 @@ on: pull_request: workflow_dispatch: + schedule: + - cron: 0 3 * * 1 # run on 03:00 UTC every Monday + concurrency: # cancel older running jobs on the same branch group: ${{ github.workflow }}-${{ github.ref }} @@ -62,6 +65,7 @@ jobs: needs: - verify - deployment-test + - upgradeability-test runs-on: ubuntu-latest steps: - name: 'Master test job' diff --git a/.github/workflows/trigger-docker-publish.yaml b/.github/workflows/trigger-docker-publish.yaml index 67205c90c..460922977 100644 --- a/.github/workflows/trigger-docker-publish.yaml +++ b/.github/workflows/trigger-docker-publish.yaml @@ -62,6 +62,9 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + - name: Log inputs + run: | + echo "Input Version: ${{ inputs.version }}, Input namespace: ${{ inputs.namespace}}" - uses: ./.github/actions/publish-docker-image name: Publish ${{ matrix.variant.img }} with: diff --git a/.github/workflows/trigger-maven-publish.yaml b/.github/workflows/trigger-maven-publish.yaml index ca7128030..94cd7594f 100644 --- a/.github/workflows/trigger-maven-publish.yaml +++ b/.github/workflows/trigger-maven-publish.yaml @@ -59,6 +59,8 @@ jobs: OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} run: |- + echo "Input Version: ${{ inputs.version }}" + # check if version input was specified, else read from gradle.properties if [ ! -z ${{ inputs.version }} ];