This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (80 loc) · 2.9 KB
/
post-upgrade.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Post-upgrade
on:
workflow_dispatch:
inputs:
build-result:
required: true
description: Whether the CI run succeeded or failed
jobs:
find-pr:
runs-on: ubuntu-latest
outputs:
number: ${{steps.find-pull-request.outputs.number}}
steps:
- name: Format branch
id: format-branch
run: echo "::set-output name=branch::$(echo ${{github.ref}} | sed 's/refs\/heads\///')"
- name: Find pull request
id: find-pull-request
uses: juliangruber/find-pull-request-action@v1
with:
branch: ${{steps.format-branch.outputs.branch}}
success:
runs-on: ubuntu-latest
needs: find-pr
if: ${{github.event.inputs.build-result == 'success'}}
steps:
- name: Merge upgrade PR
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{secrets.UPGRADE_TOKEN}}
number: ${{needs.find-pr.outputs.number}}
method: squash
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master
- name: Get Reno version
id: get-reno-version
uses: sergeysova/jq-action@v2
with:
cmd: jq -r .version version.json
- name: Get supported Deno runtime version
id: get-supported-deno-version
uses: sergeysova/jq-action@v2
with:
cmd: jq -r .deno deno_versions.json
- name: Get supported std version
id: get-supported-std-version
uses: sergeysova/jq-action@v2
with:
cmd: jq -r .std deno_versions.json
- name: Create tag
id: tag-version
uses: mathieudutour/github-tag-action@v5.6
with:
github_token: ${{secrets.UPGRADE_TOKEN}}
custom_tag: ${{steps.get-reno-version.outputs.value}}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{steps.tag-version.outputs.new_tag}}
name: ${{steps.tag_version.outputs.new_tag}}
body: This is an automated compatibility release to support Deno ${{steps.get-supported-deno-version.outputs.value}} and std ${{steps.get-supported-std-version.outputs.value}}.
token: ${{secrets.UPGRADE_TOKEN}}
failure:
runs-on: ubuntu-latest
needs: find-pr
if: ${{github.event.inputs.build-result == 'failure'}}
steps:
- name: Send failure email
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{secrets.BUILDBOT_EMAIL}}
password: ${{secrets.BUILDBOT_EMAIL_PASSWORD}}
to: hi@james.engineering
from: Reno Buildbot
subject: Reno automated upgrade failure
body: "An automated attempt to upgrade Reno has failed. Please consult the generated PR and manually intervene to resolve the issue: https://github.com/reno-router/reno/pull/${{needs.find-pr.outputs.number}}"