forked from datalad/datalad
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.51 KB
/
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
name: Auto-release on PR merge
on:
# This action should be run in workflows triggered by `pull_request_target`
# (not by regular `pull_request`!)
pull_request_target:
branches:
# Create a release whenever a PR is merged into one of these branches:
- maint
types:
- closed
# Allow manually triggering a release via a "Run workflow" button on the
# workflow's page:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
# Only run for manual runs or merged PRs with the "release" label:
if: >
github.event_name == 'workflow_dispatch'
|| (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release'))
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
token: ${{ secrets.GITMATE_GITHUB_TOKEN }}
# Check out all history so that the previous release tag can be
# found:
fetch-depth: 0
- name: Install pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Prepare release
uses: datalad/release-action/release@v1
with:
token: ${{ secrets.GITMATE_GITHUB_TOKEN }}
pypi-token: ${{ secrets.PYPI_TOKEN }}
pre-tag: |
make update-changelog
perl -pli -e "s/^version:.*/version: $new_version/" CITATION.cff
git add docs/source/changelog.rst CITATION.cff
git commit -m '[skip ci] Update docs/source/changelog.rst and CITATION.cff'