Skip to content

Commit

Permalink
Release and Publishworkflows
Browse files Browse the repository at this point in the history
Signed-off-by: pSchlarb <[email protected]>

fixed case sensitive reference

Signed-off-by: pSchlarb <[email protected]>
  • Loading branch information
pSchlarb committed Jan 10, 2023
1 parent 8744481 commit e5e7a68
Show file tree
Hide file tree
Showing 10 changed files with 675 additions and 24 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/PR.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Sovrin PR

on:
pull_request:
paths:
- '**'
- "!sovrin/metadata.json"
branches:
- master
- DevContainers

jobs:
workflow-setup:
name: Initialize Workflow
runs-on: ubuntu-latest
outputs:
GITHUB_REPOSITORY_NAME: ${{ steps.setup.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ steps.setup.outputs.distribution }}
publish: ${{ steps.setup.outputs.publish }}
testsNeeded: ${{ steps.testsNeeded.outputs.testsNeeded }}
steps:
- name: checkout source code
uses: actions/checkout@v3
- name: setup
id: setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@v1
with:
ownerRepo: "sovrin-foundation"
- name: testsNeeded
id: testsNeeded
uses: dorny/paths-filter@v2
with:
filters: |
testsNeeded:
- '**.py'
- 'sovrin/*genesis'
extract-information:
name: Extract needed Information for Indy-Test-Automation
needs: [workflow-setup]
if: ${{ needs.workflow-setup.outputs.testsNeeded == 'true' }}
runs-on: ubuntu-latest
outputs:
indyVersion: ${{ steps.indy-versions.outputs.indyVersion}}
sovtokenVersion: ${{ steps.sovtoken-versions.outputs.sovtokenVersion}}
sovtokenfeesVersion: ${{ steps.sovtoken-versions.outputs.sovtokenfeesVersion}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Set up python
run: |
pip3 install semver
- name: Get Version with UX-timestamp
id: version
run: |
echo "version=$(python3 updateVersion.py --getVersion)" >> $GITHUB_OUTPUT
- name: prepare
run: ./build-scripts/ubuntu-1604/prepare-package.sh ./ ${{ steps.version.outputs.version }}
- name: Extract Indy Versions
id: indy-versions
run: |
echo "indyVersion=$(grep -oP "\d+.\d+.\d+((-|.)?rc\d+)?" <<< $(grep -oP "indy-node==\d+.\d+.\d+((-|.)?rc\d+)?" setup.py))" >>$GITHUB_OUTPUT
- name: Extract sovtoken & sovtokenfees Version
id: sovtoken-versions
run: |
echo "sovtokenVersion=$(grep -oP "\d+.\d+.\d+((-|.)?((rc)|(dev))?\d+)?" <<< $(grep -oP "sovtoken==\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" setup.py))" >>$GITHUB_OUTPUT
echo "sovtokenfeesVersion=$(grep -oP "\d+.\d+.\d+((-|.)?((rc)|(dev))?\d+)?" <<< $(grep -oP "sovtokenfees==\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" setup.py))" >>$GITHUB_OUTPUT
build_sovrin:
name: Build Sovrin Deb
needs: [workflow-setup]
if: ${{ needs.workflow-setup.outputs.testsNeeded == 'true' }}
uses: ./.github/workflows/reuseable_build_package.yaml
with:
isDev: true

call-indy-test-automation:
name: Indy-Test-Automation
needs: [workflow-setup, extract-information, build_sovrin]
if: ${{ needs.workflow-setup.outputs.testsNeeded == 'true' }}
uses: pschlarb/indy-test-automation/.github/workflows/callable_test-automation.yaml@sovrin
with:
ubuntuVersion: "ubuntu-2004"
libsovtokenJSON: "{\"install\": \"yes\", \"version\": \"1.0.5\"}"
tokenPluginJSON: "{\"install\":\"yes\", \"sovtokenVersion\": \"${{ needs.extract-information.outputs.sovtokenVersion }}\", \"sovtokenfeesVersion\":\"${{ needs.extract-information.outputs.sovtokenfeesVersion }}\"}"
sovrinJSON: "{ \"install\": \"yes\"}"
indyJSON: "{ \"nodeVersion\": \"${{ needs.extract-information.outputs.indyVersion }}\", \"plenumVersion\" : \"1.13.1~rc2\", \"ursaVersion\": \"0.3.2-1\", \"pyzmqVersion\" : \"22.3.0\"}"
libIndyVersion: "1.15.0~1625-bionic"
includePaymentTests: true
testAutomationBranch: "sovrin"

statusCheck:
name: statusCheck
runs-on: ubuntu-latest
needs: [workflow-setup, call-indy-test-automation]
if: ${{ needs.workflow-setup.outputs.testsNeeded == 'false' || success() }}
steps:
- run: 'echo "Just a status Check (Always true, when executed) for branch protection rules(blocks merging while test are running and if tests fail)." '
105 changes: 105 additions & 0 deletions .github/workflows/PublishRelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Publish Release triggered by Version Bump merged

#disable all tags and enable all brannches and only version file
on:
push:
branches-ignore:
- update-rc-version
- update-version
paths:
- '!**'
- "sovrin/metadata.json"


jobs:
release-infos:
name: release-infos
runs-on: ubuntu-latest
outputs:
isVersionBump: ${{ steps.get-release-info.outputs.isVersionBump }}
isPreRelease: ${{ steps.get-release-info.outputs.isRC }}
versionTag: ${{ steps.get-release-info.outputs.versionTag }}
version: ${{ steps.get-release-info.outputs.version }}
component: ${{ steps.get-release-info.outputs.component}}
CACHE_KEY_BUILD: ${{ steps.workflow-setup.outputs.CACHE_KEY_BUILD }}
UBUNTU_VERSION: ${{ steps.workflow-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.workflow-setup.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ steps.workflow-setup.outputs.distribution }}
publish: ${{ steps.workflow-setup.outputs.publish}}
steps:
- name: checkout source code
uses: actions/checkout@v3
- name: get-release-info
id: get-release-info
uses: hyperledger/indy-shared-gha/.github/actions/get-release-info@v1
with:
versionString: "${{ github.event.head_commit.message }}"
- name: workflow-setup
id: workflow-setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@v1
with:
ownerRepo: "sovrin-foundation"

createRelease:
name: Create Release
needs: [release-infos]
if: needs.release-infos.outputs.isVersionBump == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download sovrin deb Artifacts from Github Action Artifacts
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: Releasepr.yaml
workflow_conclusion: success
name: sovrin.deb
path: artifacts/sovrin-deb
- name: Download sovrin python Artifacts from Github Action Artifacts
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: Releasepr.yaml
workflow_conclusion: success
name: sovrin-python
path: artifacts/sovrin-python
- name: Upload sovrin-deb
uses: actions/upload-artifact@v3
with:
name: sovrin.deb
path: artifacts/sovrin-deb
- name: Upload sovrin-python
uses: actions/upload-artifact@v3
with:
name: sovrin-python
path: artifacts/sovrin-python
- name: Generate Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.release-infos.outputs.VERSIONTAG }}
files: |
artifacts/**
generate_release_notes: true
body: "[${{ needs.release-infos.outputs.VERSIONTAG }}] "
prerelease: ${{ needs.release-infos.outputs.isPreRelease }}
target_commitish: ${{github.event.ref}}
name: "${{ needs.release-infos.outputs.VERSIONTAG }}"
token: ${{ secrets.BOT_PR_PAT }}

publish-package:
name: Sovrin Publish Packages
needs: [release-infos, createRelease]
if: needs.release-infos.outputs.publish == 'true'
uses: ./.github/workflows/reuseable_publish.yaml
with:
GITHUB_REPOSITORY_NAME: ${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}
distribution: ${{ needs.release-infos.outputs.distribution }}
UBUNTU_VERSION: ${{ needs.release-infos.outputs.UBUNTU_VERSION }}
REPO_COMPONENT: ${{ needs.release-infos.outputs.component}}
secrets:
SOVRIN_ARTIFACTORY_REPO_CONFIG: ${{ secrets.SOVRIN_ARTIFACTORY_REPO_CONFIG }}
84 changes: 65 additions & 19 deletions .github/workflows/Push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,65 @@ name: Sovrin Push

on:
push:
branches:
- master
- DevContainers
paths:
- 'sovrin/*_genesis'
- '**.py'

jobs:
workflow-setup:
name: Initialize Workflow
runs-on: ubuntu-latest
outputs:
testsNeeded: ${{ steps.testsNeeded.outputs.testsNeeded }}
steps:
- name: checkout source code
uses: actions/checkout@v3
- name: setup
id: setup
uses: hyperledger/indy-shared-gha/.github/actions/workflow-setup@v1
with:
ownerRepo: "sovrin-foundation"
- name: testsNeeded
id: testsNeeded
uses: dorny/paths-filter@v2
with:
filters: |
testsNeeded:
- '**.py'
- 'sovrin/*genesis'
extract-information:
name: Extract needed Information for Indy-Test-Automation
runs-on: ubuntu-latest
outputs:
indyVersion: ${{ steps.indy-versions.outputs.indyVersion}}
sovtokenVersion: ${{ steps.sovtoken-versions.outputs.sovtokenVersion}}
sovtokenfeesVersion: ${{ steps.sovtoken-versions.outputs.sovtokenfeesVersion}}
GITHUB_REPOSITORY_NAME: ${{ steps.repository-name.outputs.lowercase }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Convert the GitHub repository name to lowercase
id: repository-name
uses: ASzc/change-string-case-action@v5
with:
string: ${{ github.repository }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Set up python
run: |
pip3 install semver
- name: Get Version with UX-timestamp
id: version
run: |
echo "version=$(python3 updateVersion.py --getVersion)" >> $GITHUB_OUTPUT
- name: prepare
run: ./build-scripts/ubuntu-1604/prepare-package.sh ./ "1.2.0"
run: ./build-scripts/ubuntu-1604/prepare-package.sh ./ ${{ steps.version.outputs.version }}
- name: Extract Indy Versions
id: indy-versions
run: |
Expand All @@ -25,29 +70,17 @@ jobs:
run: |
echo "sovtokenVersion=$(grep -oP "\d+.\d+.\d+((-|.)?((rc)|(dev))?\d+)?" <<< $(grep -oP "sovtoken==\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" setup.py))" >>$GITHUB_OUTPUT
echo "sovtokenfeesVersion=$(grep -oP "\d+.\d+.\d+((-|.)?((rc)|(dev))?\d+)?" <<< $(grep -oP "sovtokenfees==\d+.\d+.\d+((-|.)?(rc|dev)\d+)?" setup.py))" >>$GITHUB_OUTPUT
build_sovrin:
name: Build Sovrin Deb
runs-on: ubuntu-20.04
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: setup
run: |
sudo apt-get update && sudo apt-get -y install rubygems
sudo gem install fpm
- name: Build Sovrin Deb
run: sudo bash ./build-scripts/ubuntu-1604/build-sovrin.sh ./ "1.2.0" $PWD/sovrin.deb
- name: Upload sovrin.deb
uses: actions/upload-artifact@v3
with:
name: sovrin.deb
path: ./sovrin.deb
retention-days: 5
uses: ./.github/workflows/reuseable_build_package.yaml
with:
isDev: true

call-indy-test-automation:
name: Indy-Test-Automation
needs: [extract-information,build_sovrin]
uses: pschlarb/indy-test-automation/.github/workflows/sovrin.yaml@sovrin
uses: pschlarb/indy-test-automation/.github/workflows/callable_test-automation.yaml@sovrin
with:
ubuntuVersion: "ubuntu-2004"
libsovtokenJSON: "{\"install\": \"yes\", \"version\": \"1.0.5\"}"
Expand All @@ -56,4 +89,17 @@ jobs:
indyJSON: "{ \"nodeVersion\": \"${{ needs.extract-information.outputs.indyVersion }}\", \"plenumVersion\" : \"1.13.1~rc2\", \"ursaVersion\": \"0.3.2-1\", \"pyzmqVersion\" : \"22.3.0\"}"
libIndyVersion: "1.15.0~1625-bionic"
includePaymentTests: true
testAutomationBranch: "sovrin"
testAutomationBranch: "sovrin"

publish-package:
name: Sovrin Publish Packages
needs: [workflow-setup, extract-information, call-indy-test-automation]
if: needs.workflow-setup.outputs.publish == 'true'
uses: ./.github/workflows/reuseable_publish.yaml
with:
GITHUB_REPOSITORY_NAME: ${{ needs.release-infos.outputs.GITHUB_REPOSITORY_NAME }}
distribution: focal
UBUNTU_VERSION: ubuntu-2004
REPO_COMPONENT: 'dev'
secrets:
SOVRIN_ARTIFACTORY_REPO_CONFIG: ${{ secrets.SOVRIN_ARTIFACTORY_REPO_CONFIG }}
Loading

0 comments on commit e5e7a68

Please sign in to comment.