-
Notifications
You must be signed in to change notification settings - Fork 7
executable file
·86 lines (70 loc) · 2.13 KB
/
build.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
81
82
83
84
85
86
# Runs a build test on commit to ensure functionality.
name: Build
on:
push:
branches:
- main
tags:
- '*.*.*'
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: "Set up Poetry ${{ matrix.python-version }}"
uses: Gr1N/setup-poetry@v7
with:
poetry-preview: true
- name: "Install Python deps ${{ matrix.python-version }}"
run: |
poetry install --all-extras
- name: "Check it imports ${{ matrix.python-version }}"
run: |
poetry run python -c 'import mystbin'
- name: "Build wheels ${{ matrix.python-version }}"
run: |
poetry build
- name: "Upload artifacts ${{ matrix.python-version }}"
uses: actions/upload-artifact@v2
with:
name: distributions
path: dist/*
# Credits to most of this step go to Gorialis (Devon R [https://github.com/Gorialis])
# as I found them in their Jishaku builds (https://github.com/Gorialis/jishaku/blob/d3f50749b5a977b544e5fd14894585f656247486/.github/workflows/deploy.yml#L82-L119)
create_release:
needs: [ build ]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: distributions
path: dist
- name: Set up Poetry
uses: Gr1N/setup-poetry@v7
with:
poetry-preview: true
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish