-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (70 loc) · 2.26 KB
/
release.yaml
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
---
name: Publish Releases
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: "Semver and release to publish (for example: 1.2.0-1)"
jobs:
github:
runs-on: ubuntu-latest
steps:
- name: Download Windows Release
id: download-windows-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yaml
commit: ${{github.event.pull_request.head.sha}}
name: hstsparser.exe
- name: Download RPM
id: download-rpm-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yaml
commit: ${{github.event.pull_request.head.sha}}
name: hstsparser-${{inputs.version}}.noarch.rpm
- name: Create Draft GitHub Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{inputs.version}}
generate_release_notes: true
files: |
hstsparser.exe
hstsparser-${{inputs.version}}.fc40.noarch.rpm
pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Cache Python modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.pip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.0
virtualenvs-create: false
installer-parallel: true
- name: Install Python Dependencies
run: poetry install --no-interaction --no-ansi --without=dev
env:
PIP_CACHE_DIR: ~/.pip
- name: Update Package Version
run: poetry version $(echo "${{inputs.version}}" | cut -d "-" -f 1)
- name: Publish to PyPi
run: poetry publish --build -u ${{secrets.pypi_username}} -p ${{secrets.pypi_password}}