From 97e5e000a6fcbb0416ae1f73dd5c154781b9e5b5 Mon Sep 17 00:00:00 2001 From: Petro Kurbatskyi <67897517+ibexa-yuna@users.noreply.github.com> Date: Mon, 7 Nov 2022 15:09:43 +0100 Subject: [PATCH] IBX-4145: Updated changelog generator dependencies (#154) --- .github/workflows/release_tag.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml index 3886daae..1eb116fb 100644 --- a/.github/workflows/release_tag.yml +++ b/.github/workflows/release_tag.yml @@ -16,8 +16,7 @@ jobs: - name: Set Environment run: | echo "BUILD_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # load current composer.lock - id: currentLock @@ -25,7 +24,6 @@ jobs: run: | OUT=$(jq --slurp '[.[].packages[] | select(.name | contains("ezsystems") or contains("ibexa")) | [.name, .version] | { name: (.[0]), version: .[1] }]' composer.lock) echo "lock=$( echo "$OUT" | sed ':a;N;$!ba;s/\n//g' )" >> $GITHUB_OUTPUT - - name: Get previous last full release id: prevfull run: | @@ -42,7 +40,7 @@ jobs: prevFullTag: ${{ steps.prevfull.outputs.tag }} # checkout previous tag - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ steps.prevrelease.outputs.previousTag }} @@ -52,7 +50,6 @@ jobs: run: | OUT=$(jq --slurp '[.[].packages[] | select(.name | contains("ezsystems") or contains("ibexa")) | [.name, .version] | { name: (.[0]), version: .[1] }]' composer.lock) echo "lock=$( echo "$OUT" | sed ':a;N;$!ba;s/\n//g' )" >> $GITHUB_OUTPUT - # do some magic comparing those outputs - id: output_data name: Do comparison and output JSON with changes @@ -74,7 +71,6 @@ jobs: # 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 "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: matrix: ${{ steps.output_data.outputs.matrix }} @@ -88,7 +84,6 @@ jobs: - name: Set Environment run: | echo "BUILD_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - - name: Get previous release tag based on type id: prevrelease uses: ibexa/version-logic-action@master @@ -96,20 +91,19 @@ jobs: currentTag: ${{ env.BUILD_TAG }} - name: Checkout Generator - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ibexa/changelog-generator-action ref: v2 - name: Setup Python environment - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install pygithub & jira run: | - pip install pygithub jira - + pip install pygithub jira github-action-utils - name: Run generator in a loop id: generator env: @@ -128,6 +122,7 @@ jobs: export GITHUB_REPOSITORY=$(jq -r '.name' <<< "$i") export INPUT_PREVIOUSTAG=$(jq -r '.versions[0]' <<< "$i") export INPUT_CURRENTTAG=$(jq -r '.versions[1]' <<< "$i") + echo Running against $GITHUB_REPOSITORY echo -n "## " >> generator_output python main.py >> generator_output echo '' >> generator_output @@ -135,7 +130,6 @@ jobs: echo "CHANGELOG_OUTPUT<> $GITHUB_ENV echo "$(cat generator_output)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - - name: Create Release id: create_release uses: zendesk/action-create-release@v1 @@ -147,7 +141,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Archive markdown - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: changelogs path: generator_output