mirror of
https://github.com/ElementsProject/lightning.git
synced 2026-08-13 12:32:55 +02:00
ci: bind docker/pypi workflow inputs via env before shell
Pass platforms-to-build, docker hub owner/version/push-latest, and dist-location through env: before run: scripts (script-injection class). Co-authored-by: Cursor <cursoragent@cursor.com> Changelog-None
This commit is contained in:
parent
7faac86fc1
commit
a0598a2d81
3 changed files with 22 additions and 9 deletions
4
.github/workflows/docker-build.yml
vendored
4
.github/workflows/docker-build.yml
vendored
|
|
@ -23,8 +23,10 @@ jobs:
|
|||
platforms: ${{ steps.plan.outputs.platforms }}
|
||||
steps:
|
||||
- id: plan
|
||||
env:
|
||||
PLATFORMS_TO_BUILD: ${{ inputs.platforms-to-build }}
|
||||
run: |
|
||||
IFS=',' read -ra ARR <<< "${{ inputs.platforms-to-build }}"
|
||||
IFS=',' read -ra ARR <<< "$PLATFORMS_TO_BUILD"
|
||||
JSON=$(printf '%s\n' "${ARR[@]}" | jq -R . | jq -sc .)
|
||||
echo "platforms=$JSON" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
|
|
|||
19
.github/workflows/docker-publish.yml
vendored
19
.github/workflows/docker-publish.yml
vendored
|
|
@ -43,25 +43,34 @@ jobs:
|
|||
merge-multiple: false
|
||||
|
||||
- name: Set up values
|
||||
env:
|
||||
DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }}
|
||||
PUSH_LATEST: ${{ inputs.push-latest }}
|
||||
VERSION: ${{ inputs.version }}
|
||||
REF_TYPE: ${{ github.ref_type }}
|
||||
run: |
|
||||
DIGEST_REFS=""
|
||||
for f in /tmp/digests/*/digest.txt; do
|
||||
D=$(cat "$f")
|
||||
DIGEST_REFS="$DIGEST_REFS ${{ inputs.dh-repository-owner }}/lightningd@${D}"
|
||||
DIGEST_REFS="$DIGEST_REFS ${DH_REPOSITORY_OWNER}/lightningd@${D}"
|
||||
done
|
||||
echo "DIGEST_REFS=$DIGEST_REFS" >> $GITHUB_ENV
|
||||
|
||||
if [[ "${{ inputs.push-latest }}" == "true" ]] ||
|
||||
([[ "${{ github.ref_type }}" == "tag" ]] && [[ ! "${{ inputs.version }}" =~ rc ]]); then
|
||||
if [[ "$PUSH_LATEST" == "true" ]] ||
|
||||
([[ "$REF_TYPE" == "tag" ]] && [[ ! "$VERSION" =~ rc ]]); then
|
||||
echo "PUSHLATEST=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "PUSHLATEST=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Create and push real tag(s)
|
||||
env:
|
||||
DH_REPOSITORY_OWNER: ${{ inputs.dh-repository-owner }}
|
||||
VERSION: ${{ inputs.version }}
|
||||
TAG_SUFFIX: ${{ matrix.tag_suffix }}
|
||||
run: |
|
||||
TAG_ARGS=(-t "${{ inputs.dh-repository-owner }}/lightningd:${{ inputs.version }}${{ matrix.tag_suffix }}")
|
||||
TAG_ARGS=(-t "${DH_REPOSITORY_OWNER}/lightningd:${VERSION}${TAG_SUFFIX}")
|
||||
if [[ "$PUSHLATEST" == "true" ]]; then
|
||||
TAG_ARGS+=(-t "${{ inputs.dh-repository-owner }}/lightningd:latest${{ matrix.tag_suffix }}")
|
||||
TAG_ARGS+=(-t "${DH_REPOSITORY_OWNER}/lightningd:latest${TAG_SUFFIX}")
|
||||
fi
|
||||
docker buildx imagetools create "${TAG_ARGS[@]}" $DIGEST_REFS
|
||||
|
|
|
|||
8
.github/workflows/pypi-publish.yml
vendored
8
.github/workflows/pypi-publish.yml
vendored
|
|
@ -30,9 +30,11 @@ jobs:
|
|||
|
||||
- name: Determine PyPI distribution location
|
||||
id: set-values
|
||||
run: |
|
||||
if [[ "${{ inputs.dist-location }}" != "" ]]; then
|
||||
DISTLOCATION="${{ inputs.dist-location }}"
|
||||
env:
|
||||
DIST_LOCATION: ${{ inputs.dist-location }}
|
||||
run: |
|
||||
if [[ -n "$DIST_LOCATION" ]]; then
|
||||
DISTLOCATION="$DIST_LOCATION"
|
||||
elif [[ "${{ github.ref_type }}" == "tag" ]] && [[ ! "${{ inputs.version }}" =~ rc ]]; then
|
||||
DISTLOCATION="prod"
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue