diff --git a/.github/workflows/tag_deploy.yml b/.github/workflows/tag_deploy.yml index 75e8c02..1185794 100644 --- a/.github/workflows/tag_deploy.yml +++ b/.github/workflows/tag_deploy.yml @@ -39,7 +39,7 @@ on: - '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+' env: - PUPPET_VERSION: '~> 6' + PUPPET_VERSION: '~> 7' jobs: releng-checks: @@ -55,7 +55,7 @@ jobs: clean: true - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 2.7 bundler-cache: true - run: bundle exec rake pkg:check_version - run: bundle exec rake pkg:compare_latest_tag @@ -72,6 +72,7 @@ jobs: runs-on: ubuntu-latest outputs: prerelease: ${{ steps.tag-check.outputs.prerelease }} + tag: ${{ steps.tag-check.outputs.tag }} steps: - name: Checkout code uses: actions/checkout@v3 @@ -99,30 +100,29 @@ jobs: echo "tag=$tag" | tee -a "$GITHUB_OUTPUT" echo "prerelease=$prerelease" | tee -a "$GITHUB_OUTPUT" - echo "annotation_title=$annotation_title" | tee -a "$GITHUB_OUTPUT" echo "TARGET_TAG=$tag" | tee -a "$GITHUB_ENV" # Prepare annotation body as a file for the next step # # * The GitHub Release renders the text in this file as markdown - # * The file is needed because GITHUB_OUTPUT only supports single lines # * The `perl -pe` removes RPM-style date headers from the CHANGELOG, # because they don't render well as markdown on the Release page - # + echo "RELEASE_MESSAGE<> "$GITHUB_ENV" + printf '%s\n\n' "$annotation_title" >> "$GITHUB_ENV" echo "$annotation" | tail -n +2 | \ - perl -pe 'BEGIN{undef $/;} s/\n\* (Mon|Tue|Wed|Thu|Fri|Sat|Sun) .*?\n//smg;' > /tmp/annotation.body + perl -pe 'BEGIN{undef $/;} s/\n\* (Mon|Tue|Wed|Thu|Fri|Sat|Sun) .*?\n//smg;' >> "$GITHUB_ENV" + echo "EOF$$" >> "$GITHUB_ENV" - name: Create Release - uses: actions/create-release@v1 id: create_release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ steps.tag-check.outputs.annotation_title }} - body_path: /tmp/annotation.body - prerelease: ${{ steps.tag-check.outputs.prerelease == 'yes'}} - draft: false + run: | + echo "${RELEASE_MESSAGE}" > /tmp/.commit-msg.txt + args=(--file /tmp/.commit-msg.txt) + [[ ${{ steps.tag-check.outputs.prerelease }} == yes ]] && args+=(--prerelease) + + hub release create ${args[@]} "$TARGET_TAG" build-and-attach-rpms: name: Trigger RPM release @@ -137,16 +137,11 @@ jobs: - centos7 - centos8 steps: - - name: Get tag & annotation info (${{github.ref}}) - id: tag-check - run: | - tag="${GITHUB_REF/refs\/tags\//}" - echo "tag=$tag" >> $GITHUB_OUTPUT - name: Trigger RPM release workflow (${{ matrix.os }}) uses: actions/github-script@v6 env: DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} - TARGET_TAG: ${{ steps.tag-check.outputs.tag }} + TARGET_TAG: ${{ needs.create-github-release.outputs.tag }} with: github-token: ${{ secrets.SIMP_AUTO_GITHUB_TOKEN__REPO_SCOPE }} script: | @@ -184,7 +179,7 @@ jobs: clean: true - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 2.7 bundler-cache: true - name: Build Puppet module (PDK) run: bundle exec pdk build --force