Create Prerelease #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Prerelease | |
on: | |
workflow_dispatch: | |
jobs: | |
create_prerelease: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Install Ruby 3.3 | |
uses: ruby/setup-ruby@ff740bc00a01b3a50fffc55a1071b1060eeae9dc # tag v1.180.0 | |
with: | |
ruby-version: 3.3 | |
- name: Checkout code | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2 | |
- run: bundle | |
- name: Update files with new version | |
run: bundle exec rake newrelic:version:bump | |
- name: Update newrelic.yml | |
run: bundle exec rake newrelic:update_newrelicyml | |
- name: Set tag name | |
run: echo "prerelease_tag=$(bundle exec rake newrelic:version:current)-pre" >> $GITHUB_ENV | |
- name: Create pull request | |
run: | | |
git checkout -b "prerelease_updates_${{ env.prerelease_tag }}" | |
git add --all | |
git config --global user.email ${{ secrets.EMAIL }} | |
git config --global user.name 'newrelic-ruby-agent-bot' | |
git commit -m "bump version" | |
git push --set-upstream origin "prerelease_updates_${{ env.prerelease_tag }}" | |
gh pr create --label $LABEL --title "$TITLE" --body "$BODY" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TITLE: "Prerelease ${{env.prerelease_tag}}" | |
BODY: "Updates the version number, changelog, and newrelic.yml (if it needs updating). This is an automated PR." | |
LABEL: prerelease | |
- name: Create pre release tag | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # tag v0.1.15 | |
with: | |
tag_name: ${{ env.prerelease_tag }} | |
name: ${{ env.prerelease_tag }} | |
target_commitish: prerelease_updates_${{ env.prerelease_tag }} | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |