-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (40 loc) · 1.06 KB
/
python-rpmbuild.yml
File metadata and controls
42 lines (40 loc) · 1.06 KB
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
name: Upload Release Asset
on:
push:
tags:
- 'v*'
workflow_dispatch:
release:
types:
- created
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build SDIST
run: |
python setup.py sdist -d ./dist/SOURCES/
- name: Build RPM
if: startsWith(github.ref, 'refs/tags/')
run: |
V=$GITHUB_REF
V=${V#refs/tags/}
V=${V#v}
V=${V%%-*}
rpmbuild -bb ./python-storable.spec --define "_topdir $GITHUB_WORKSPACE/dist" --define "version $V"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/RPMS/noarch/python-storable-*.rpm