-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (62 loc) · 2.1 KB
/
build.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
name: build
on:
push:
pull_request:
release:
types:
- published
- edited
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run tests
uses: ./.devcontainer
with:
args: make all
- name: Run tests with config
uses: ./.devcontainer
with:
args: make all AUTOFFF_CONFIG=config.ini
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build distribution files
uses: ./.devcontainer
with:
args: poetry build
- name: Upload distribution files as artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
needs: [test, build]
steps:
- name: Download distribution files
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist
- name: Publish autofff to TestPyPI
if: ${{ github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.TEST_PYPI_USERNAME }}
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish autofff to PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_API_TOKEN }}