Skip to content

Commit 00eaa32

Browse files
committed
new: dev: add baseline test and release workflows
Signed-off-by: Stephen L Arnold <[email protected]>
1 parent 53dba90 commit 00eaa32

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed

.github/workflows/release.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
# release on tag push
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
wheels:
11+
12+
runs-on: ${{ matrix.os }}
13+
defaults:
14+
run:
15+
shell: bash
16+
env:
17+
PYTHONIOENCODING: utf-8
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, macos-latest]
22+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
23+
24+
steps:
25+
- name: Set git crlf/eol
26+
run: |
27+
git config --global core.autocrlf false
28+
git config --global core.eol lf
29+
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip wheel
42+
pip install tox
43+
44+
- name: Build dist pkgs
45+
run: |
46+
tox -e build,check
47+
48+
- name: Upload artifacts
49+
if: matrix.python-version == 3.9 && runner.os == 'Linux'
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: wheels
53+
path: |
54+
./dist/*.whl
55+
./dist/*.tar.gz
56+
57+
create_release:
58+
name: Create Release
59+
needs: [wheels]
60+
runs-on: ubuntu-20.04
61+
62+
steps:
63+
- name: Get version
64+
id: get_version
65+
run: |
66+
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
67+
echo ${{ env.VERSION }}
68+
69+
- uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0
72+
73+
# download all artifacts to project dir
74+
- uses: actions/download-artifact@v4
75+
76+
- name: Generate changes file
77+
uses: sarnold/gitchangelog-action@master
78+
with:
79+
github_token: ${{ secrets.GITHUB_TOKEN}}
80+
81+
- name: Create release
82+
id: create_release
83+
uses: softprops/action-gh-release@master
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
tag_name: ${{ env.VERSION }}
88+
name: Release v${{ env.VERSION }}
89+
body_path: CHANGES.md
90+
draft: false
91+
prerelease: false
92+
files: |
93+
wheels/*.whl
94+
wheels/*.tar.gz

.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
defaults:
14+
run:
15+
shell: bash
16+
env:
17+
OS: ${{ matrix.os }}
18+
PYTHON: ${{ matrix.python-version }}
19+
PYTHONIOENCODING: utf-8
20+
PIP_DOWNLOAD_CACHE: ${{ github.workspace }}/../.pip_download_cache
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-latest, macos-latest]
25+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
26+
steps:
27+
- name: Set git crlf/eol
28+
run: |
29+
git config --global core.autocrlf false
30+
git config --global core.eol lf
31+
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Install dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install tox tox-gh-actions
45+
46+
- name: Lint with tox
47+
run: tox -e lint
48+
49+
- name: Run tests
50+
run: |
51+
tox
52+
env:
53+
PLATFORM: ${{ matrix.os }}
54+
55+
- name: Build pkg
56+
run: tox -e build,check

0 commit comments

Comments
 (0)