-
Notifications
You must be signed in to change notification settings - Fork 7
83 lines (78 loc) · 2.74 KB
/
Copy pathci.yml
File metadata and controls
83 lines (78 loc) · 2.74 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
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
name: tests-and-publish
# this pipeline started as an adaptation of the pipeline of the
# FlexMeasures client (https://github.com/FlexMeasures/flexmeasures-client/)
on:
push:
# Avoid using all the resources/limits available by checking only
# relevant branches and tags. Other branches can be checked via PRs.
branches: [main]
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' # Match tags that resemble a version
- 'v[0-9]+\.[0-9]+\.[0-9]+' # Match tags that resemble a version
pull_request: # Run in every PR
workflow_dispatch: # Allow manually triggering the workflow
schedule:
# Run roughly every 15 days at 00:00 UTC
# (useful to check if updates on dependencies break the package)
- cron: '0 0 1,16 * *'
concurrency:
group: >-
${{ github.workflow }}-${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
checks:
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
uses: ./.github/workflows/check-python.yml
with:
python-version: ${{ matrix.python }}
publish:
needs: checks
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/s2-python/
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0} # deep clone for setuptools-scm
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: pip
cache-dependency-path: dev-requirements.txt
- name: Install development dependencies
run: python -m pip install -r dev-requirements.txt
- name: Build package distribution files
run: python -m tox -e build
- name: Publish Package
uses: pypa/gh-action-pypi-publish@release/v1
test-publish:
needs: checks
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/test') }}
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/s2-python/
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0} # deep clone for setuptools-scm
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: pip
cache-dependency-path: dev-requirements.txt
- name: Install development dependencies
run: python -m pip install -r dev-requirements.txt
- name: Build package distribution files
run: python -m tox -e build
- name: Publish Package
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/