-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (82 loc) · 2.9 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
# matrixctl
# Copyright (c) 2020 Michael Sasser <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
---
name: Upload Release Asset
on:
push:
tags:
- "v*"
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/[email protected]
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Build project
run: poetry build
- name: Zip project
run: zip --junk-paths matrixctl.zip dist/* README.md LICENSE.txt
- name: Generate changelog_latest.rst from CHANGELOG.rst
run: python scripts/get_latest_release.py
- name: Convert from changelog_latest.rst to changelog_latest.md
uses: docker://pandoc/core:2.16.2
with:
args: >-
--output=chagelog_latest.md
--from rst
--to markdown
--markdown-headings=atx
chagelog_latest.rst
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Create Release
uses: softprops/action-gh-release@v1
with:
prerelease: false
draft: false
name: Release ${{ steps.get_version.outputs.VERSION }}
body_path: chagelog_latest.md
files: matrixctl.zip
- name: Delete temp files
run: rm -rf matrixctl.zip chagelog_latest.md chagelog_latest.rst
- name: pypi-publish
uses: pypa/[email protected]
with:
# PyPI user
# user: # optional, default is __token__
# Password for your PyPI user or an access token
password: ${{ secrets.pypi_token }}
# The repository URL to use
# repository_url: # optional
# The target directory for distribution
# packages_dir: # optional, default is dist