diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4f29523f9..ced83855a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,6 +22,9 @@ on: # - 'minor' # - 'patch' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + jobs: analyse-changed-packages: runs-on: ubuntu-latest @@ -127,10 +130,17 @@ jobs: echo "$changelog" echo "{${{ matrix.package }} v$changelog}" >> $GITHUB_STEP_SUMMARY - changelog="${changelog//'%'/'%25'}" - changelog="${changelog//$'\n'/'%0A'}" - changelog="${changelog//$'\r'/'%0D'}" - echo "changelog=$changelog" >> $GITHUB_OUTPUT + + { + echo 'CHANGELOG<> "$GITHUB_ENV" + + echo "MULTI_LINES_TEXT_ENV_VAR<> $GITHUB_ENV + # here we can place the command that will generate multi-line text + echo $changelog >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV working-directory: ${{ steps.get-directory.outputs.directory }} env: @@ -138,10 +148,11 @@ jobs: - name: Determine next version number if: inputs.releaseVersion == 'auto' + id: determine_next_version run: | nextVersion=`pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -P -o '(\d+\.)(\d+\.)(\d)' | head -n 1` echo "$nextVersion" - echo "NEXT_VERSION=$nextVersion" >> $GITHUB_ENV + echo "NEXT_VERSION=$nextVersion" >> $GITHUB_OUTPUT working-directory: ${{ steps.get-directory.outputs.directory }} env: MATRIX_PACKAGE: ${{ matrix.package }} @@ -192,9 +203,10 @@ jobs: if: inputs.dryRun == false env: GITHUB_TOKEN: ${{ secrets.PAT }} # # use PAT to being able to push to protected branch later on + CHANGELOG: ${{ steps.get_changelog.outputs.CHANGELOG }} with: - tag: $NEXT_VERSION - name: $NEXT_VERSION + tag: $MATRIX_PACKAGE@v${{ steps.determine_next_version.outputs.NEXT_VERSION }} + name: $MATRIX_PACKAGE@v${{ steps.determine_next_version.outputs.NEXT_VERSION }} prerelease: true body: | - ${{ steps.get_changelog.outputs.changelog }} + ${{ env.CHANGELOG }}