-
Notifications
You must be signed in to change notification settings - Fork 22
61 lines (53 loc) · 2.06 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Tag and release
on:
workflow_dispatch:
inputs:
description:
description: Release description (used as tag message and GitHub release body)
required: true
jobs:
release:
name: Tag and release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Set changelog release date
run: |
scripts/set_release_date > version
echo "::set-output name=version::$(cat version)"
id: set_release_date
- name: Commit changelog and tag release
run: |
git add CHANGES.rst
git commit -m "Set ${{ steps.set_release_date.outputs.version }} release date"
git push origin HEAD
git tag -a ${{ steps.set_release_date.outputs.version }} -m "${{ github.event.inputs.description }}"
git push origin ${{ steps.set_release_date.outputs.version }}
- name: Create GitHub release (triggers publish-to-pypi workflow)
uses: zendesk/action-create-release@746afbc52c1d78025a1a55b59ccd4f89208d4474 # master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
tag_name: ${{ steps.set_release_date.outputs.version }}
release_name: ${{ steps.set_release_date.outputs.version }}
body: ${{ github.event.inputs.description }}
draft: false
prerelease: false
- name: Create next changelog release section
run: |
scripts/insert_next_release > version
echo "::set-output name=version::$(cat version)"
id: insert_next_release
- name: Commit changelog
run: |
git add CHANGES.rst
git commit -m "Create ${{ steps.insert_next_release.outputs.version }} changelog section"
git push origin HEAD