diff --git a/.github/workflows/PR.yaml b/.github/workflows/PR.yaml index 1de71a9ebf..d38653b9e3 100644 --- a/.github/workflows/PR.yaml +++ b/.github/workflows/PR.yaml @@ -4,7 +4,6 @@ on: branches: # - master - ubuntu-20.04-upgrade - - ReleaseWorkflow paths: - '**.py' @@ -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 @@ -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 }} diff --git a/.github/workflows/Push.yaml b/.github/workflows/Push.yaml index e71ea1d581..fa2daabb58 100644 --- a/.github/workflows/Push.yaml +++ b/.github/workflows/Push.yaml @@ -4,7 +4,6 @@ on: branches: # - master - ubuntu-20.04-upgrade - - ReleaseWorkflow paths: - '**.py' @@ -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 @@ -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 }} @@ -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 }} diff --git a/.github/workflows/README.md b/.github/workflows/README.md index bed9cb0c17..9e4db42de2 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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. \ No newline at end of file + This workflow runs the tests inside the uploaded docker images. \ No newline at end of file diff --git a/.github/workflows/publishRelease.yaml b/.github/workflows/publishRelease.yaml index 2ae11ed912..2f558428b0 100644 --- a/.github/workflows/publishRelease.yaml +++ b/.github/workflows/publishRelease.yaml @@ -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 @@ -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 }} @@ -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 }}"}' \ No newline at end of file + # 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 }}"}' \ No newline at end of file diff --git a/.github/workflows/releasepr.yaml b/.github/workflows/releasepr.yaml index 616b559f84..809e25418c 100644 --- a/.github/workflows/releasepr.yaml +++ b/.github/workflows/releasepr.yaml @@ -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 @@ -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 }} diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index efb16a513a..13423ba887 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -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 diff --git a/docs/source/diagrams/release-workflow.png b/docs/source/diagrams/release-workflow.png new file mode 100644 index 0000000000..d1bb91150d Binary files /dev/null and b/docs/source/diagrams/release-workflow.png differ diff --git a/docs/source/diagrams/release-workflow.puml b/docs/source/diagrams/release-workflow.puml new file mode 100644 index 0000000000..9f5e91509f --- /dev/null +++ b/docs/source/diagrams/release-workflow.puml @@ -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..[-rc]"" + +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 diff --git a/plenum/__metadata__.py b/plenum/__metadata__.py index 6ff06bfdb6..dcd4db3b35 100644 --- a/plenum/__metadata__.py +++ b/plenum/__metadata__.py @@ -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() diff --git a/plenum/__version__.json b/plenum/__version__.json index 7d0772953e..1319e6fe26 100644 --- a/plenum/__version__.json +++ b/plenum/__version__.json @@ -1 +1 @@ -[1, 14, 0, "rc", 7] +[1, 13, 0, "dev", 0]