forked from tardis-sn/tardis
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (116 loc) · 4.24 KB
/
post-release.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# For more information about TARDIS pipelines, please refer to:
#
# https://tardis-sn.github.io/tardis/contributing/development/continuous_integration.html
name: post-release
on:
release:
types: [published]
workflow_dispatch: # manual trigger
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: tardis-sn/tardis
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 0
- name: Install github-changes
run: sudo npm install -g github-changes
- name: Update changelog
run: github-changes -o tardis-sn -r tardis --only-pulls --use-commit-body -f CHANGELOG.md -k ${{ secrets.BOT_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: changelog
path: CHANGELOG.md
citation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Wait for Zenodo webhook
run: sleep 180
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install doi2cff
run: pip install git+https://github.com/citation-file-format/doi2cff
- name: Update CITATION.cff
run: |
rm CITATION.cff
doi2cff init 10.5281/zenodo.592480
- uses: actions/upload-artifact@v3
with:
name: citation
path: CITATION.cff
credits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Wait for Zenodo webhook
run: sleep 180
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install rst-include
run: pip install rst-include==2.1.2.2 requests==2.27.1
- name: Update README.rst
run: python .ci-helpers/update_credits.py
- uses: actions/upload-artifact@v3
with:
name: credits
path: |
README.rst
docs/resources/credits.rst
pull_request:
needs: [changelog, citation, credits]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: /tmp
- name: Copy files to repository
run: |
cp /tmp/changelog/CHANGELOG.md .
cp /tmp/citation/CITATION.cff .
cp -r /tmp/credits/* .
- name: Get current date
run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.BOT_TOKEN }}
committer: TARDIS Bot <[email protected]>
author: TARDIS Bot <[email protected]>
branch: post-release-${{ env.DATE }}
base: master
push-to-fork: tardis-bot/tardis
commit-message: Automated changes for post-release ${{ env.DATE }}
title: Post-release ${{ env.DATE }}
body: |
*\*beep\* \*bop\**
Hi, human.
These are the changes required after the latest TARDIS release.
> :warning: **Warning:**
>
> The `post_release` workflow waits for a webhook and then updates the citation files. If the file is not modified by this pull request, please check the latest release on [Zenodo's website](https://zenodo.org/record/592480), close this pull request, and [manually run the workflow](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow).
>
> This pull request should be auto-merged.
labels: build-docs
reviewers: wkerzendorf, andrewfullard, epassaro
id: create-pr
- name: Wait for pull request
run: sleep 30
- name: Approve pull request
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ secrets.PR_APPROVAL_TOKEN }}
number: ${{ steps.create-pr.outputs.pull-request-number }}
if: steps.create-pr.outputs.pull-request-operation == 'created'
- name: Enable automerge
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.BOT_TOKEN }}
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }}
merge-method: squash