forked from hyperledger/indy-plenum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hyperledger#1541 from udosson/publishing-artifacts
Publishing artifacts
- Loading branch information
Showing
8 changed files
with
369 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Declare files that will always have LF line endings on checkout. | ||
**/publishPackages text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Publish Debian Packages" | ||
description: > | ||
Publish debian packages to artifactory using the jfrog cli. | ||
This action wraps a script that performs organized publishing of debian packages. | ||
inputs: | ||
sourceDirectory: | ||
description: "The directory containing the packages to be published." | ||
required: true | ||
distribution: | ||
description: "The distribution supported by the package. i.e xenial, focal, etc." | ||
required: true | ||
component: | ||
description: "The component type. i.e. stable, rc, dev, etc." | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Publish | ||
shell: bash | ||
run: | | ||
${{ github.action_path }}/publishPackages "${{ inputs.sourceDirectory }}" "${{ inputs.distribution }}" "${{ inputs.component }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
SCRIPT_HOME="$( cd "$( dirname "$0" )" && pwd )" | ||
|
||
sourceDirectory=${1} | ||
distribution=${2} | ||
component=${3} | ||
uploadSpec=${UPLOAD_SPEC:-${4:-"${SCRIPT_HOME}/upload-spec.json"}} | ||
|
||
export CI=true | ||
|
||
fileList=$(find "${sourceDirectory}" -type f -name '*.deb' -mindepth 1 -maxdepth 1 -printf "%f\n" 2>/dev/null) | ||
for name in ${fileList}; do | ||
shortName=$(echo "${name}" | sed -rn 's~^(python3-)?([^.]*)_.*.deb~\2~p') | ||
architecture=$(echo "${name}" | sed -rn 's~^.*_(.*).deb~\1~p') | ||
startingLetter=$(echo "${shortName}" | sed -rn 's~^(.).*~\1~p') | ||
|
||
echo "=====================================================================================================================" | ||
echo "name: ${name}" | ||
echo "shortName: ${shortName}" | ||
echo "architecture: ${architecture}" | ||
echo "startingLetter: ${startingLetter}" | ||
echo "distribution: ${distribution}" | ||
echo "component: ${component}" | ||
echo "uploadSpec: ${uploadSpec}" | ||
echo "---------------------------------------------------------------------------------------------------------------------" | ||
jfrog rt u \ | ||
--deb ${distribution}/${component}/${architecture} \ | ||
--spec ${uploadSpec}\ | ||
--spec-vars "SOURCE_DIR=${sourceDirectory};PACKAGE_NAME=${name};COMPONENT=${component};PACKAGE_STARTING_LETTER=${startingLetter};PACKAGE_SHORT_NAME=${shortName}" \ | ||
--detailed-summary | ||
echo "=====================================================================================================================" | ||
echo | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"files": [ | ||
{ | ||
"pattern": "${SOURCE_DIR}/${PACKAGE_NAME}", | ||
"target": "indy/pool/${COMPONENT}/${PACKAGE_STARTING_LETTER}/${PACKAGE_SHORT_NAME}/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: "Set Version" | ||
description: "Sets version parameters and makes them available as outputs for subsequent processes." | ||
|
||
inputs: | ||
moduleName: | ||
description: "The name of the module containing the version management APIs for the project; i.e. load_version and set_version" | ||
required: true | ||
default: "plenum" | ||
isDev: | ||
description: "A flag indicating whether or not this is a dev build; set to either 'true' or 'false'." | ||
required: true | ||
default: false | ||
isRC: | ||
description: "A flag indicating whether or not this is a release candidate build; set to either 'true' or 'false'." | ||
required: true | ||
default: false | ||
|
||
outputs: | ||
targetReleaseVer: | ||
description: "The target release version." | ||
value: ${{ steps.versions.outputs.targetReleaseVer }} | ||
upstreamVer: | ||
description: "The version number to use with Python packages." | ||
value: ${{ steps.versions.outputs.upstreamVer }} | ||
pkgVer: | ||
description: "The version number to use with Debian packages." | ||
value: ${{ steps.versions.outputs.pkgVer }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set Versions | ||
id: versions | ||
shell: bash | ||
run: | | ||
fullVersion=$(python3 -c "from ${{ inputs.moduleName }} import load_version; print(load_version().full)") | ||
release=$(python3 -c "from ${{ inputs.moduleName }} import load_version; print(load_version().release)") | ||
pre=$(python3 -c "from ${{ inputs.moduleName }} import load_version; pre = load_version().parts[-2]; print('' if pre is None else pre)") | ||
revision=$(python3 -c "from ${{ inputs.moduleName }} import load_version; rev = load_version().parts[-1]; print('' if rev is None else rev)") | ||
targetReleaseVer=${release} | ||
upstreamVer=${targetReleaseVer} | ||
pkgVer=${upstreamVer} | ||
if [ ${{ inputs.isDev }} == "true" ] || [ ${{ inputs.isRC }} == "true" ]; then | ||
if [ ${{ inputs.isDev }} == "true" ]; then | ||
rev=${{ github.run_number }} | ||
else | ||
rev=${revision} | ||
fi | ||
upstreamVer+=".${pre}${rev}" | ||
pkgVer+="~${pre}${rev}" | ||
fi | ||
# Set Outputs ... | ||
echo "::set-output name=targetReleaseVer::${targetReleaseVer}" | ||
echo "::set-output name=upstreamVer::${upstreamVer}" | ||
echo "::set-output name=pkgVer::${pkgVer}" | ||
echo "Target Release version: ${targetReleaseVer}" | ||
echo "PyPI Release version: ${upstreamVer}" | ||
echo "Debian Release version: ${pkgVer}" |
Oops, something went wrong.