mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Supporting replacements in NightlyReleases.
This commit is contained in:
22
.github/workflows/NightlyRelease.yml
vendored
22
.github/workflows/NightlyRelease.yml
vendored
@@ -59,6 +59,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
replacements:
|
||||||
|
description: 'Multi-line string containing search=replace patterns.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
assets:
|
assets:
|
||||||
description: 'Multi-line string containing artifact:file:title asset descriptions.'
|
description: 'Multi-line string containing artifact:file:title asset descriptions.'
|
||||||
required: true
|
required: true
|
||||||
@@ -170,6 +175,19 @@ jobs:
|
|||||||
|
|
||||||
export GH_TOKEN=${{ github.token }}
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
Replace() {
|
||||||
|
line="$1"
|
||||||
|
while IFS=$'\r\n' read -r patternLine; do
|
||||||
|
# skipp empty lines
|
||||||
|
[[ "$patternLine" == "" ]] && continue
|
||||||
|
|
||||||
|
pattern="${patternLine%%=*}"
|
||||||
|
replacement="${patternLine#*=}"
|
||||||
|
line="${line//"%$pattern%"/"$replacement"}"
|
||||||
|
done <<<'${{ inputs.replacements }}'
|
||||||
|
echo "$line"
|
||||||
|
}
|
||||||
|
|
||||||
ERRORS=0
|
ERRORS=0
|
||||||
# A dictionary of 0/1 to avoid duplicate downloads
|
# A dictionary of 0/1 to avoid duplicate downloads
|
||||||
declare -A downloadedArtifacts
|
declare -A downloadedArtifacts
|
||||||
@@ -190,6 +208,10 @@ jobs:
|
|||||||
asset="${asset#"${asset%%[![:space:]]*}"}"
|
asset="${asset#"${asset%%[![:space:]]*}"}"
|
||||||
title="${title#"${title%%[![:space:]]*}"}"
|
title="${title#"${title%%[![:space:]]*}"}"
|
||||||
|
|
||||||
|
# apply replacements
|
||||||
|
asset="$(Replace "${asset}")"
|
||||||
|
title="$(Replace "${title}")"
|
||||||
|
|
||||||
echo "Publish asset '${asset}' from artifact '${artifact}' with title '${title}'"
|
echo "Publish asset '${asset}' from artifact '${artifact}' with title '${title}'"
|
||||||
echo -n " Checked asset for duplicates ... "
|
echo -n " Checked asset for duplicates ... "
|
||||||
if [[ -n "${assetFilenames[$asset]}" ]]; then
|
if [[ -n "${assetFilenames[$asset]}" ]]; then
|
||||||
|
|||||||
2
.github/workflows/_Checking_JobTemplates.yml
vendored
2
.github/workflows/_Checking_JobTemplates.yml
vendored
@@ -7,8 +7,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
ConfigParams:
|
ConfigParams:
|
||||||
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
|
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
|
||||||
needs:
|
|
||||||
- DocCoverage
|
|
||||||
with:
|
with:
|
||||||
package_name: pyDummy
|
package_name: pyDummy
|
||||||
|
|
||||||
|
|||||||
10
.github/workflows/_Checking_Nightly.yml
vendored
10
.github/workflows/_Checking_Nightly.yml
vendored
@@ -81,11 +81,15 @@ jobs:
|
|||||||
The following asset categories are provided for pyGHDL:
|
The following asset categories are provided for pyGHDL:
|
||||||
* Platform specific Python wheel package for Ubuntu incl. `pyGHDL...so`
|
* Platform specific Python wheel package for Ubuntu incl. `pyGHDL...so`
|
||||||
* Platform specific Python wheel package for Windows incl. `pyGHDL...dll`
|
* Platform specific Python wheel package for Windows incl. `pyGHDL...dll`
|
||||||
|
replacements: |
|
||||||
|
version=2.0
|
||||||
|
tool=myTool
|
||||||
|
prog=program
|
||||||
assets: |
|
assets: |
|
||||||
document: document1.txt: Documentation
|
document: document1.txt: Documentation
|
||||||
document: build.log: Logfile
|
document: build.log: Logfile - %tool% - %tool%
|
||||||
other: document1.txt: SBOM
|
other: document1.txt: SBOM - %version%
|
||||||
other: program.py: Application
|
other: %prog%.py: Application - %tool% - %version%
|
||||||
document:!archive1.zip: Archive 1 - zip
|
document:!archive1.zip: Archive 1 - zip
|
||||||
document:!archive2.tgz: Archive 2 - tgz
|
document:!archive2.tgz: Archive 2 - tgz
|
||||||
document:!archive3.tar.gz: Archive 3 - tar.gz
|
document:!archive3.tar.gz: Archive 3 - tar.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user