forked from corvis/prana_rc
-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (91 loc) · 3.12 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
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to be assigned for this release'
required: true
jobs:
run:
name: Release a new version
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 1
ref: '${{ github.ref }}'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
- name: Set new version
run: |
make set-version VERSION="${{ github.event.inputs.version }}"
- name: Apply formatting, coppyright, lint
run: make NO_VENV=True
- name: Build packages
run: make build NO_VENV=True
- name: Publish packages
run: make publish NO_VENV=True PYPI_API_KEY=${{ secrets.pypi_password }}
- uses: heinrichreimer/[email protected]
id: generate_changelog_file
with:
token: ${{ secrets.GITHUB_TOKEN }}
output: CHANGELOG.md
futureRelease: v${{ github.event.inputs.version }}
unreleased: true
issues: true
# addSections: '{ "notable-change": {"prefix": "**NotableChanges:**", "labels": ["notable-change"]} }'
- uses: heinrichreimer/[email protected]
id: generate_release_changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
output: RELEASE_CHANGELOG.md
unreleasedOnly: true
issues: true
headerLabel: '## Changelog'
stripGeneratorNotice: true
stripHeaders: true
unreleasedLabel: ''
# addSections: '{ "notable-change": {"prefix": "**NotableChanges:**", "labels": ["notable-change"]} }'
- name: Read Changelog
# This is a workaround for https://github.com/heinrichreimer/action-github-changelog-generator/issues/7
id: release_changelog
uses: juliangruber/read-file-action@v1
with:
path: ./RELEASE_CHANGELOG.md
- name: Bump version
uses: EndBug/add-and-commit@v5
with:
author_name: Github Bot
author_email: [email protected]
message: "Version bump and changelog update. New version is ${{ github.event.inputs.version }}"
add: "./src/prana_rc/__version__.py CHANGELOG.md"
push: true
tag: "v${{ github.event.inputs.version }} --force"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge development -> master
uses: devmasx/[email protected]
with:
type: now
from_branch: '${{ github.ref }}'
target_branch: master
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 'v${{ github.event.inputs.version }}'
release_name: 'Version ${{ github.event.inputs.version }}'
body: |
${{ steps.release_changelog.outputs.content }}
draft: false
prerelease: true