-
-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (78 loc) · 2.7 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
# ds2000 - The Python Library for Rigol DS2000 Oscilloscopes
# Copyright (c) 2020 Michael Sasser <Michael@MichaelSasser.org>
#
# 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/checkout@v3.5.3
- name: Set up Python 3.9
uses: actions/setup-python@v4.7.0
with:
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1.3
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3.3.1
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Build project
run: poetry build
- name: pypi-publish
uses: pypa/gh-action-pypi-publish@v1.8.8
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
- name: Zip project
run: zip --junk-paths ds2000.zip dist/* README.md LICENSE.txt
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ds2000.zip
asset_name: ds2000.zip
asset_content_type: application/zip