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

Fixed Auto Tag workflow for newer JQ version #518

Open
wants to merge 1 commit into
base: 4.6
Choose a base branch
from
Open
Changes from all 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
29 changes: 21 additions & 8 deletions .github/workflows/auto_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ on:

jobs:
preparation:
runs-on: ubuntu-22.04
# This should allow parallel runs in a chain, e.g. OSS->Headless->Experience->Commerce
runs-on: ubuntu-latest
# This should allow parallel runs in a chain, e.g. OSS->Content->Experience->Commerce
# whilst allowing Satis to process
timeout-minutes: 30

Expand All @@ -42,7 +42,20 @@ jobs:
# select(.version == "${{ env.V_VERSION }}"): filters the array to only include objects where the version property is equal to the value of the environment variable V_VERSION.

# No need to validate for oss version in satis
# No need to validate for headless version in satis
- name: Validate satis for content version
if: github.event.repository.name == 'experience'
env:
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
PARENT: ibexa/content
V_VERSION: v${{ inputs.version }}
run: |
for EXPONENTIAL_BACKOFF in {1..10}; do
curl https://updates.ibexa.co/p2/${PARENT}.json -s -u $SATIS_NETWORK_KEY:$SATIS_NETWORK_TOKEN | jq -e '.packages."${{ env.PARENT }}"[] | select(.version == "${{ env.V_VERSION }}")' && break;
DELAY=$((2**$EXPONENTIAL_BACKOFF))
echo "${PARENT}:${V_VERSION} not yet available, sleeping for $DELAY seconds"
sleep $DELAY
done
- name: Validate satis for experience version
if: github.event.repository.name == 'commerce'
Expand Down Expand Up @@ -71,7 +84,7 @@ jobs:
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3
coverage: none
extensions: pdo_sqlite, gd
tools: cs2pr
Expand All @@ -84,7 +97,7 @@ jobs:
installation_id: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
private_key: ${{ secrets.AUTOMATION_CLIENT_SECRET }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down Expand Up @@ -131,7 +144,7 @@ jobs:
run: jq '.require["ibexa/oss"] |= "${{ inputs.version }}"' composer.json | sponge composer.json
- name: Patch parent version for Experience
if: github.event.repository.name == 'experience'
run: jq '.require["ibexa/headless"] |= "${{ inputs.version }}"' composer.json | sponge composer.json
run: jq '.require["ibexa/content"] |= "${{ inputs.version }}"' composer.json | sponge composer.json
- name: Patch parent version for Commerce
if: github.event.repository.name == 'commerce'
run: jq '.require["ibexa/experience"] |= "${{ inputs.version }}"' composer.json | sponge composer.json
Expand All @@ -140,12 +153,12 @@ jobs:
# if they exist, to update the values of the keys in the require object.
- name: Patch composer require versions
run: |
jq --argfile release release.json '
jq --slurpfile release <(cat release.json) '
.require |= (
to_entries |
map({
key: .key,
value: (if ($release[.key]) then $release[.key] else .value end)
value: (if ($release[0][.key]) then $release[0][.key] else .value end)
}) | from_entries
)
' composer.json > composer.tmp
Expand Down
Loading