Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Release Workflow & Gha refactoring #1749

Merged
merged 10 commits into from
May 16, 2022
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/actions/getNewNodeVersion/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Get New NodeVersion"
description: "Sets version parameters and makes them available as outputs for subsequent processes."

inputs:
isRC:
description: "A flag indicating whether or not this is a release candidate build; set to either 'true' or 'false'."
required: true
default: "true"

outputs:
nodeVersion:
description: "The new Version. (Bumped Patch by 1)"
value: ${{ steps.versions.outputs.nodeVersion }}

runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Get Versions
id: versions
shell: bash
run: |
major=$(python3 -c "from indy_node import load_version; patch = load_version().parts[0]; print('' if patch is None else patch)")
minor=$(python3 -c "from indy_node import load_version; patch = load_version().parts[1]; print('' if patch is None else patch)")
patch=$(python3 -c "from indy_node import load_version; patch = load_version().parts[2]; patch+=1; print('' if patch is None else patch)")
if [[ "${{ inputs.isRC }}" == "true" ]]; then
echo ::set-output\ name=nodeVersion::${major}.${minor}.${patch}rc1
else
echo ::set-output\ name=nodeVersion::${major}.${minor}.${patch}
fi
23 changes: 0 additions & 23 deletions .github/actions/publish-deb/action.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/actions/publish-deb/publishPackages

This file was deleted.

8 changes: 0 additions & 8 deletions .github/actions/publish-deb/upload-spec.json

This file was deleted.

63 changes: 0 additions & 63 deletions .github/actions/set-version/action.yaml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/PR.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Indy Node - PR Workflow
on:
pull_request:
branches:
- ubuntu-20.04-upgrade
- feature/did-indy*
paths:
- '**.py'
- '.github/**'
- 'build-scripts/**'
- 'bump_version.sh'
workflow_dispatch:

jobs:
workflow-setup:
name: Initialize Workflow
runs-on: ubuntu-latest
outputs:
CACHE_KEY_BUILD: ${{ steps.setup.outputs.CACHE_KEY_BUILD }}
UBUNTU_VERSION: ${{ steps.setup.outputs.UBUNTU_VERSION }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.setup.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ steps.setup.outputs.distribution }}
publish: ${{ steps.setup.outputs.publish }}
steps:
- name: checkout source code
uses: actions/checkout@v2
- name: setup
id: setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@main

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

build-image:
name: Create Builder Image
needs: [workflow-setup, lint]
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 }}/node-build
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}

indy_node_tests:
name: Indy Node Tests
needs: [workflow-setup, build-image]
uses: ./.github/workflows/reuseable_test.yaml
with:
GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}

build_packages:
name: Build Packages
needs: [workflow-setup, indy_node_tests]
uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@main
with:
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/node-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
isDev: true
isRC: false
moduleName: indy_node
78 changes: 78 additions & 0 deletions .github/workflows/Push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Indy Node - Push Workflow
on:
push:
branches:
- ubuntu-20.04-upgrade
- feature/did-indy*
paths:
- '**.py'
- '.github/**'
- 'build-scripts/**'
- 'bump_version.sh'

jobs:
workflow-setup:
name: Initialize Workflow
runs-on: ubuntu-latest
outputs:
CACHE_KEY_BUILD: ${{ steps.setup.outputs.CACHE_KEY_BUILD }}
UBUNTU_VERSION: ${{ steps.setup.outputs.UBUNTU_VERSION }}
# Expose the lowercase version of the GitHub repository name
# to all subsequent jobs that reference image repositories
# as the push and pull operations require the URL of the repository
# to be in lowercase.
GITHUB_REPOSITORY_NAME: ${{ steps.setup.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ steps.setup.outputs.distribution }}
publish: ${{ steps.setup.outputs.publish }}
steps:
- name: checkout source code
uses: actions/checkout@v2
- name: setup
id: setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@main

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

build-image:
name: Create Builder Image
needs: [workflow-setup, lint]
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 }}/node-build
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}

indy_node_tests:
name: Indy Node Tests
needs: [workflow-setup, build-image]
uses: ./.github/workflows/reuseable_test.yaml
with:
GITHUB_REPOSITORY_NAME: ${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}

build_packages:
name: Build Packages
needs: [workflow-setup, indy_node_tests]
uses: hyperledger/indy-shared-gha/.github/workflows/buildpackages.yaml@main
with:
DOCKER_IMAGE: ghcr.io/${{ needs.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}/node-build:${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
isDev: true
isRC: false
moduleName: indy_node

publish_artifacts:
name: Publish Artifacts
needs: [workflow-setup, build_packages]
if: needs.workflow-setup.outputs.publish == 'true'
uses: hyperledger/indy-shared-gha/.github/workflows/publish_artifacts.yaml@main
with:
COMPONENT: 'dev'
UBUNTU_VERSION: ${{ needs.workflow-setup.outputs.UBUNTU_VERSION }}
distribution: ${{ needs.workflow-setup.outputs.distribution }}
moduleName: indy_node
secrets:
INDY_ARTIFACTORY_REPO_CONFIG: ${{ secrets.INDY_ARTIFACTORY_REPO_CONFIG }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
20 changes: 9 additions & 11 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +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 this folder.
The [PR](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.

+ [buildimage.yaml](buildimage.yaml)
This workflow builds the dockerimages and pushes them to the GHCR.
+ [test.yaml](test.yaml)
This workflow runs the tests inside the uploaded docker images.
+ [buildpackages.yaml](buildpackages.yaml)
This workflows builds the python and debian packages. It also uploads them to the workflow.
+ [publish_artifacts.yaml](publish_artifacts.yaml)
This workflow uploads the packages to PYPI and Artifactory.
The [tag](tag.yaml), [releasepr](releasepr.yaml) and [publishRelease](publishRelease.yaml) workflows are used for the new [Release Workflow](../../docs/release-workflow.png).
They use reuseable workflows from the [indy-shared-gha](https://github.com/hyperledger/indy-shared-gha) repository and the following workflow in this folder.

+ [reuseable_test.yaml](reuseable_test.yaml)
This workflow runs the tests inside the uploaded docker images.
Loading