Skip to content

Commit da3b251

Browse files
committed
Update workflows
1 parent 3d5ca13 commit da3b251

File tree

5 files changed

+108
-87
lines changed

5 files changed

+108
-87
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Python Tests
2+
3+
on: [push]
4+
5+
6+
jobs:
7+
test:
8+
name: Run tests
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python: ["3.9", "3.10", "3.11", "3.12"]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install Python tools
16+
uses: BrandonLWhite/[email protected]
17+
- name: Setup Python with poetry caching
18+
# poetry cache requires poetry to already be installed, weirdly
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
cache: poetry
23+
24+
- name: Test
25+
run: |-
26+
poetry install --extras=test
27+
poe test
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Make a release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version of the new release, just as a number with no prepended "v"'
8+
required: true
9+
10+
env:
11+
PYTHON_VERSION: 3.9
12+
NEW_VERSION: ${{ inputs.version }}
13+
NEW_TAG: v${{ inputs.version }}
14+
15+
jobs:
16+
increment-version:
17+
name: Bump version, commit and create tag
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install Python tools
22+
uses: BrandonLWhite/[email protected]
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ env.PYTHON_VERSION }}
26+
cache: poetry
27+
28+
- name: Bump project version
29+
run: poetry version "${{ env.NEW_VERSION }}"
30+
31+
- uses: EndBug/add-and-commit@v9
32+
id: commit_and_tag
33+
name: Commit the changes and create tag
34+
with:
35+
message: "Increment version to ${{ env.NEW_VERSION }}"
36+
tag: "${{ env.NEW_TAG }} --force"
37+
38+
build:
39+
name: Build the distribution package
40+
runs-on: ubuntu-latest
41+
needs: increment-version
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
ref: ${{ env.NEW_TAG }}
46+
47+
- name: Install Python tools
48+
uses: BrandonLWhite/[email protected]
49+
- uses: actions/setup-python@v5
50+
with:
51+
python-version: ${{ env.PYTHON_VERSION }}
52+
cache: poetry
53+
54+
- name: Build a binary wheel and a source tarball
55+
run: poetry build
56+
57+
- name: Store the package
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: python-package-distributions
61+
path: dist/
62+
63+
publish-to-pypi:
64+
name: Publish distribution 📦 to PyPI
65+
runs-on: ubuntu-latest
66+
needs: build
67+
environment:
68+
name: pypi
69+
url: https://pypi.org/p/confuse
70+
permissions:
71+
id-token: write
72+
steps:
73+
- name: Download all the dists
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: python-package-distributions
77+
path: dist/
78+
- name: Publish distribution 📦 to PyPI
79+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ env.OPTS.default = "-p no:cov"
4646
[tool.poe.tasks.test-with-coverage]
4747
help = "Run tests and record coverage"
4848
ref = "test"
49-
# record coverage in audioread package
50-
# save xml for coverage upload to coveralls
49+
# record coverage in confuse package
50+
# save xml for coverage upload to codecov
5151
# save html report for local dev use
5252
# measure coverage across logical branches
5353
# show which tests cover specific lines in the code (see the HTML report)

0 commit comments

Comments
 (0)