-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (44 loc) · 1.46 KB
/
next_version.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
---
name: Increment Version & Create Draft PR
on:
workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pull-requests: write
jobs:
increment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: deploy/staging
- name: Set GitHub Deploy Key
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.REPO_PRIVATE_KEY }}
- name: Bump Version
id: increment
run: |
perl -pi -e 's/(@app_version "\d+\.\d+\.)(\d+)(")/$1 . ($2+1) . $3/e' app/mix.exs
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add app/mix.exs
git commit -m "Bump version to $(sed -rn 's/^\s*@app_version\s+"(.+)"$/\1/p' app/mix.exs)"
git push origin deploy/staging
- name: Read PR Template
id: template
uses: jaywcjlove/github-action-read-file@main
with:
path: .github/PULL_REQUEST_TEMPLATE/production.md
- name: Create New Production PR
uses: repo-sync/pull-request@v2
with:
source_branch: deploy/staging
destination_branch: main
pr_label: "release"
pr_title: Deploy vX.X.X to production
pr_body: |
${{ steps.template.outputs.content }}
pr_draft: true