Skip to content

Commit

Permalink
Merge branch '4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ibexa-yuna committed Nov 7, 2022
2 parents 90db815 + c8673f7 commit fa23840
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ jobs:
name: Gather latest package information
run: |
OUT=$(jq --slurp '[.[].packages[] | select(.name | contains("ezsystems") or contains("ibexa")) | [.name, .version] | { name: (.[0]), version: .[1] }]' composer.lock)
echo "::set-output name=lock::$( echo "$OUT" | sed ':a;N;$!ba;s/\n/%0A/g' )"
echo "lock=$( echo "$OUT" | sed ':a;N;$!ba;s/\n//g' )" >> $GITHUB_OUTPUT
- name: Get previous last full release
id: prevfull
run: |
OUT=$(hub api /repos/${{ github.repository }}/releases | jq -r -s '[ .[][].tag_name | select(. | contains("rc") or contains("beta") or contains("alpha") | not) ] | first')
echo "tag=$( echo "$OUT" )" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get previous last full release
id: prevfull
Expand All @@ -50,7 +58,7 @@ jobs:
name: Gather previous package information
run: |
OUT=$(jq --slurp '[.[].packages[] | select(.name | contains("ezsystems") or contains("ibexa")) | [.name, .version] | { name: (.[0]), version: .[1] }]' composer.lock)
echo "::set-output name=lock::$( echo "$OUT" | sed ':a;N;$!ba;s/\n/%0A/g' )"
echo "lock=$( echo "$OUT" | sed ':a;N;$!ba;s/\n//g' )" >> $GITHUB_OUTPUT
# do some magic comparing those outputs
- id: output_data
Expand All @@ -72,7 +80,7 @@ jobs:
# Step 5: (outer brackets) Wrap that into JSON list of objects
# Note: zzzz is added as an additional suffix to properly sort out alpha/beta/etc pre-releases (v2.5.1-alphazzzz < v2.5.1zzzz)
OUT=$(jq -s 'flatten | group_by(.name)' $FILE1 $FILE2 | jq -s '[ .[][] | {name: (.[0].name), versions: [ .[0].version, .[1].version ] | unique} | select(.versions | length > 1) ] | .[].versions |= sort_by( . + "zzzz" | [scan("[0-9]+|[a-z]+")] | map(tonumber? // .) )')
echo "::set-output name=matrix::$( echo "$OUT" | sed ':a;N;$!ba;s/\n/%0A/g' )"
echo "matrix=$( echo "$OUT" | sed ':a;N;$!ba;s/\n//g' )" >> $GITHUB_OUTPUT
# this step is needed, so the output gets to the next defined job
outputs:
Expand Down Expand Up @@ -131,15 +139,17 @@ jobs:
python main.py >> generator_output
echo '' >> generator_output
done
echo "::set-output name=output::$( cat generator_output | sed ':a;N;$!ba;s/\n/%0A/g' )"
echo "CHANGELOG_OUTPUT<<EOF" >> $GITHUB_ENV
echo "$(cat generator_output)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: zendesk/action-create-release@v1
with:
tag_name: ${{ env.BUILD_TAG }}
body: |
${{ steps.generator.outputs.output }}
${{ env.CHANGELOG_OUTPUT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit fa23840

Please sign in to comment.