Skip to content

Commit

Permalink
Fixed references and Diagram for PR
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Schlarb <p.schlarb@esatus.com>
  • Loading branch information
pSchlarb committed May 10, 2022
1 parent 6586fb0 commit ed1ce1d
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 57 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/PR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
# - master
- ubuntu-20.04-upgrade
- ReleaseWorkflow
paths:
- '**.py'

Expand All @@ -27,16 +26,16 @@ jobs:
uses: actions/checkout@v2
- name: setup
id: setup
uses: pschlarb/indy-shared-gha/.github/actions/workflow-setup@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@main

lint:
name: Lint
uses: pschlarb/indy-shared-gha/.github/workflows/lint.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/lint.yaml@main

build-docker-image:
name: Create Builder Image
needs: [workflow-setup, lint]
uses: pschlarb/indy-shared-gha/.github/workflows/buildimage.yaml@parametrization
uses: pschlarb/indy-shared-gha/.github/workflows/buildimage.yaml@main
with:
CACHE_KEY_BUILD: ${{ needs.workflow-setup.outputs.CACHE_KEY_BUILD }}
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build
Expand All @@ -53,7 +52,7 @@ jobs:
build_packages:
name: Build Packages
needs: [workflow-setup, plenum_tests]
uses: pschlarb/indy-shared-gha/.github/workflows/buildpackages.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@main
with:
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/Push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
# - master
- ubuntu-20.04-upgrade
- ReleaseWorkflow
paths:
- '**.py'

Expand All @@ -27,16 +26,16 @@ jobs:
uses: actions/checkout@v2
- name: setup
id: setup
uses: pschlarb/indy-shared-gha/.github/actions/workflow-setup@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@main

lint:
name: Lint
uses: pschlarb/indy-shared-gha/.github/workflows/lint.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/lint.yaml@main

build-docker-image:
name: Create Builder Image
needs: [workflow-setup, lint]
uses: pschlarb/indy-shared-gha/.github/workflows/buildimage.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/buildimage.yaml@main
with:
CACHE_KEY_BUILD: ${{ needs.workflow-setup.outputs.CACHE_KEY_BUILD }}
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build
Expand All @@ -53,7 +52,7 @@ jobs:
build_packages:
name: Build Packages
needs: [workflow-setup, plenum_tests]
uses: pschlarb/indy-shared-gha/.github/workflows/buildpackages.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@main
with:
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
Expand All @@ -64,7 +63,7 @@ jobs:
publish_artifacts:
name: Publish Artifacts
needs: [workflow-setup, build_packages]
uses: pschlarb/indy-shared-gha/.github/workflows/publish_artifacts.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/publish_artifacts.yaml@main
with:
COMPONENT: 'dev'
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# GitHub Actions Workflow
# GitHub Actions Workflows

The workflow in the [push_pr.yaml](push_pr.yaml) file runs on push and pull requests to the ubuntu-20-04-upgrade branch.
It uses the following reusable workflows in thisfolder.
The [PR](push_pr.yaml) workflow runs on Pull Requests to the ubuntu-20.04-upgrade branch,
which only contain changes to python files. If no python file is affected it doesn't run.
The same applies to the [Push](Push.yaml) workflow respectively for pushes.

The [tag](tag.yaml), [releasepr](releasepr.yaml) and [publishRelease](publishRelease.yaml) workflows are used for the new [Release Workflow](../../docs/source/diagrams/release-workflow.png).
They use reuseable workflows from the [indy-shared-gha](https://github.com/hyperledger) repository and the following workflow in this folder.

+ [reuseable_lint.yaml](reuseable_lint.yaml)
This workflow runs the linting with flake8.
+ [reuseable_buildimage.yaml](reuseable_buildimage.yaml)
This workflow builds the dockerimages and pushes them to the GHCR.
+ [reuseable_test.yaml](reuseable_test.yaml)
This workflow runs the tests inside the uploaded docker images.
+ [reusable_buildpackages.yaml](reusable_buildpackages.yaml)
This workflows builds the python and debian packages. It also uploads them to the workflow.
+ [reuseable_publish_artifacts.yaml](reuseable_publish_artifacts.yaml)
This workflow uploads the packages to PYPI and Artifactory.
This workflow runs the tests inside the uploaded docker images.
29 changes: 15 additions & 14 deletions .github/workflows/publishRelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
uses: actions/checkout@v2
- name: get-release-info
id: get-release-info
uses: pschlarb/indy-shared-gha/.github/actions/get-release-info@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/get-release-info@main
with:
versionString: "${{ github.event.head_commit.message }}"
- name: workflow-setup
id: workflow-setup
uses: pschlarb/indy-shared-gha/.github/actions/workflow-setup@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@main

createRelease:
name: Create Release
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
name: Publish Artifacts
needs: [release-infos, createRelease]
if: needs.release-infos.outputs.isVersionBump == 'true'
uses: pschlarb/indy-shared-gha/.github/workflows/publish_artifacts.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/publish_artifacts.yaml@main
with:
COMPONENT: ${{ needs.release-infos.component }}
UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
Expand All @@ -120,14 +120,15 @@ jobs:
INDY_ARTIFACTORY_REPO_CONFIG: ${{ secrets.INDY_ARTIFACTORY_REPO_CONFIG }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

triggerNodeUpdate:
runs-on: ubuntu-latest
needs: [release-infos, publish_artifacts]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.NEOBOT }}
repository: wadebarnes/workflow-trigger-test
event-type: plenum-updated
client-payload: '{"version": "${{ needs.release_infos.outputs.version }}"}'
# WIP: Triggering a node Upgrade after Plenum has been updated
# triggerNodeUpdate:
# runs-on: ubuntu-latest
# needs: [release-infos, publish_artifacts]
# steps:
# - name: Repository Dispatch
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ secrets.NEOBOT }}
# repository: wadebarnes/workflow-trigger-test
# event-type: plenum-updated
# client-payload: '{"version": "${{ needs.release_infos.outputs.version }}"}'
10 changes: 5 additions & 5 deletions .github/workflows/releasepr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ jobs:
uses: actions/checkout@v2
- name: get-release-info
id: get-release-info
uses: pschlarb/indy-shared-gha/.github/actions/get-release-info@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/get-release-info@main
with:
versionString: "${{ github.event.pull_request.body }}"
- name: workflow-setup
id: workflow-setup
uses: pschlarb/indy-shared-gha/.github/actions/workflow-setup@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@main

lint:
name: Lint
needs: [release-infos]
if: needs.release-infos.outputs.isVersionBump == 'true'
uses: pschlarb/indy-shared-gha/.github/workflows/lint.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/lint.yaml@main

build-docker-image:
name: Create Builder Image
needs: [release-infos, lint]
if: needs.release-infos.outputs.isVersionBump == 'true'
uses: pschlarb/indy-shared-gha/.github/workflows/buildimage.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/buildimage.yaml@main
with:
CACHE_KEY_BUILD: ${{ needs.release-infos.outputs.CACHE_KEY_BUILD }}
DOCKER_IMAGE: ghcr.io/${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build
Expand All @@ -62,7 +62,7 @@ jobs:
name: Build Packages
needs: [release-infos, plenum_tests]
if: needs.release-infos.outputs.isVersionBump == 'true'
uses: pschlarb/indy-shared-gha/.github/workflows/buildpackages.yaml@parametrization
uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@main
with:
DOCKER_IMAGE: ghcr.io/${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}/plenum-build:${{ needs.release-infos.outputs.UBUNTU_VERSION }}
UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,10 @@ jobs:
echo "::debug::BASE is being set to $branch"
- name: get-release-info
id: get-release-info
uses: pschlarb/indy-shared-gha/.github/actions/get-release-info@parametrization
uses: hyperledger/indy-shared-gha/.github/actions/get-release-info@main
with:
versionString: "${{ github.ref }}"

triggerTest:
runs-on: ubuntu-latest
needs: [taginfos]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.NEOBOT }}
repository: wadebarnes/workflow-trigger-test
event-type: plenum-updated
client-payload: '{"version": "${{ needs.taginfos.outputs.version }}"}'

bump_version:
name: Bump Version Number
needs: taginfos
Expand Down
Binary file added docs/source/diagrams/release-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions docs/source/diagrams/release-workflow.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@startuml New Release Workflow

:**Tag Triggered - Release Workflow**;
start

:Create a tag on the branch and commit on which the release
is to be based.

The tag must be in the following format:
- ""setRelease-v<Major>.<Minor>.<Patch>[-rc<Num>]""

Examples:
- To generate an RC Release (marked as a pre-release)
- ""setRelease-v1.12.6-rc0""
- To generate an official Release
- ""setRelease-v1.12.6"";

partition "**Workflow**: tag.yaml" {
floating note left
Workflow triggered
by the ""setRelease""
tag being pushed.
end note

:Extract information;
note left:Extract version number from tag
:Bump version number;
:Create Pull Request to the branch, where the tag was set on;
}

partition "**Workflow**: releasepr.yaml" {
floating note left
Workflow triggered
by Pull Request affecting
**ONLY** ""plenum/_version_.json"".
end note

:Extract information;
if (isVersionBump) then (yes)
:Lint using ""indy-shared-gha"";
:build Docker-images using ""indy-shared-gha"";
:Execute tests (""reuseable_tests.yaml"");
:build packages using ""indy-shared-gha"";
note left: packages published to workflow
else (no)
endif
}

if (**Review PR** - All tests passed?) then (Merge PR)
partition "**Workflow**: publishRelease.yaml" {
floating note right
Workflow triggered by
pushes affecting
**ONLY**
""plenum/_version_.json"".
end note

:Extract version number from the commit message;
if (isVersionBump) then (yes)
:Download artifacts from last successfull ""releasepr"" run;
:Create a GitHub Release;
:Set tag and title to match release version;

if (is RC Release) then (yes)
:Set pre-release checkbox;
else (no)
endif
:Publish GitHub Release
- Containing the artifacts;
:Publish Packages using ""indy-shared-gha"";
:Trigger node update process;
note left: WIP
else (no)
endif
}
else (Close PR without Merging)
:Release process aborted;
endif

stop
@enduml
2 changes: 1 addition & 1 deletion plenum/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def set_manifest(manifest: Any, manifest_file: str = MANIFEST_FILE):
_f.write('\n')


__title__ = 'indy-plenum-newgha'
__title__ = 'indy-plenum'
__version_info__ = load_version()
__version__ = __version_info__.full
__manifest__ = load_manifest()
Expand Down
2 changes: 1 addition & 1 deletion plenum/__version__.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1, 14, 0, "rc", 7]
[1, 13, 0, "dev", 0]

0 comments on commit ed1ce1d

Please sign in to comment.