-
Notifications
You must be signed in to change notification settings - Fork 600
55 lines (46 loc) · 1.82 KB
/
prerelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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@a6e6f86333f0a2523ece813039b8b4be04560854 # tag v1.190.0
with:
ruby-version: 3.3
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7
- 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@c062e08bd532815e2082a85e87e3ef29c3e6d191 # tag v2.0.8
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 }}