-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (72 loc) · 2.67 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
# 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 Python Version ${{ matrix.python-version }}"
run: echo '${{ matrix.python-version }}' > .python-version
- name: Setup Rye
id: setup-rye
uses: eifinger/setup-rye@v4
with:
version: "0.41.0"
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Project Dependencies
run: |
rye pin --no-update-requires-python '3.12'
rye sync --all-features
- name: Build project
run: rye build --all --clean
- name: Zip project
run: zip --junk-paths matrixctl.zip dist/* README.md LICENSE.txt
- name: Generate changelog_latest.md
run: git cliff --latest > changelog_latest.md
- 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@v2
with:
prerelease: false
draft: false
name: Release ${{ steps.get_version.outputs.VERSION }}
body_path: changelog_latest.md
files: matrixctl.zip
- name: Delete temp files
run: rm -rf matrixctl.zip changelog_latest.md
- name: Publish
run: rye publish --token <your_token> --yes --skip-existing
# - 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