Skip to content

Commit a1423ed

Browse files
committed
Readded release and testing default workflows to match master
1 parent 930cf9f commit a1423ed

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/mp-cite
13+
permissions:
14+
id-token: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
21+
with:
22+
python-version: 3.12
23+
24+
- name: Build
25+
run: uv-build
26+
27+
- name: Publish
28+
run: uv-publish --trusted-publishing always
29+
30+
docs:
31+
runs-on: ubuntu-latest
32+
needs:
33+
- publish
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v6
40+
with:
41+
python-version: 3.12
42+
43+
- name: Install deps
44+
run: uv sync --locked --all-extras --dev
45+
46+
- name: Generate changelog
47+
uses: charmixer/auto-changelog-action@v1
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
exclude_labels: dependencies
51+
52+
- name: Commit files
53+
run: |
54+
git config --local user.email "feedback@materialsproject.org"
55+
git config --local user.name "materialsproject"
56+
git stash
57+
git pull origin main
58+
mv CHANGELOG.md docs/
59+
git add docs/CHANGELOG.md && git commit -m 'Updated CHANGELOG.md'
60+
61+
- name: Push changes
62+
uses: ad-m/github-push-action@master
63+
with:
64+
github_token: ${{ secrets.GITHUB_TOKEN }}
65+
# integrate mkdocs at some point

.github/workflows/testing.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: testing
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: ["ubuntu-latest"]
14+
python-version: ["3.11", "3.12", "3.13"]
15+
16+
name: mp-cite (${{ matrix.os }}/py${{ matrix.python-version }})
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install the project
27+
run: uv sync --locked --all-extras --dev
28+
29+
- name: Run tests
30+
env:
31+
ELINK_REVIEW_API_TOKEN: ${{ secrets.ELINK_REVIEW_API_TOKEN }}
32+
ELINK_REVIEW_ENDPOINT: ${{ secrets.ELINK_REVIEW_ENDPOINT }}
33+
run: uv run pytest tests
34+
# codecov?

0 commit comments

Comments
 (0)