-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (76 loc) · 1.94 KB
/
publish.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
name: Publish on Github and PyPi
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-package:
name: Build Python package
runs-on: ubuntu-latest
env:
cache-key: build_cache
steps:
- name: Checkout current code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Restore Cache
id: python-restore
uses: actions/cache/restore@v3
with:
path: /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages
key: ${{ env.cache-key }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: python-files
path: dist/
retention-days: 1
publish-github:
name: Create a release on Github
runs-on: ubuntu-latest
needs: build-package
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@master
with:
name: python-files
path: dist/
- name: Publish on Github
uses: ncipollo/release-action@v1
with:
makeLatest: true
artifacts: dist/*
artifactErrorsFailBuild: true
publish-pypi:
name: Publish on PyPi
runs-on: ubuntu-latest
needs: publish-github
permissions:
id-token: write
actions: write
steps:
- name: Download artifacts
uses: actions/download-artifact@master
with:
name: python-files
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT }}
repository: prochy-exe/subsplease-scraper
event-type: new_release