Skip to content

Commit c3277aa

Browse files
committed
skip: updated github workflows
1 parent 4ca2978 commit c3277aa

File tree

4 files changed

+70
-20
lines changed

4 files changed

+70
-20
lines changed

.github/workflows/from_commit_to_lint_test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
1+
# ┌───────────────────────────────────────────────────────────────┐
2+
# │ Contents of from_commit_to_lint_test.yml │
3+
# ├───────────────────────────────────────────────────────────────┘
4+
#
5+
# ├──┐From commit
6+
# │ └── Lint and test
7+
#
8+
# └───────────────────────────────────────────────────────────────
9+
10+
# ################################################################ From commit
311

412
name: Lint and test Python package
513

14+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
15+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
16+
617
on:
718
push:
819
branches: [ "master" ]
@@ -13,6 +24,8 @@ on:
1324
- '**.py'
1425
branches: [ "master" ]
1526

27+
# ################################ Lint and test
28+
1629
jobs:
1730
test:
1831
name: Lint and test

.github/workflows/from_tag_to_build_release_pypi.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
name: Create release and deploy to PyPI from a new tag
1+
# ┌───────────────────────────────────────────────────────────────┐
2+
# │ Contents of from_tag_to_build_release_pypi.yml │
3+
# ├───────────────────────────────────────────────────────────────┘
4+
#
5+
# ├──┐From tag
6+
# │ └──┐Build and test
7+
# │ ├── Release to GitHub
8+
# │ └── Deploy to PyPI
9+
#
10+
# └───────────────────────────────────────────────────────────────
11+
12+
# ################################################################ From tag
13+
14+
name: Create GitHub release and deploy to PyPI from a new tag
15+
16+
# requirements: PyPI API token
17+
18+
# debug:
19+
# git push --delete origin v2.1.0 && git tag --delete v2.1.0
20+
# git -a && git commit --amend
21+
# git push --force
22+
# git tag v2.1.0 && git push --tags
223

324
on:
425
push:
526
tags:
627
- 'v*'
728
jobs:
829

30+
# ################################ Build and test
31+
932
build:
1033
name: Test and build package
1134
runs-on: ubuntu-latest
@@ -21,7 +44,7 @@ jobs:
2144
python-version: ["3.12"]
2245
steps:
2346
- name: Access source code
24-
uses: actions/checkout@v4
47+
uses: actions/checkout@master
2548
# needed to list changes
2649
with:
2750
fetch-depth: 0
@@ -33,6 +56,7 @@ jobs:
3356
- name: Install dependencies
3457
run: |
3558
python -m pip install --upgrade pip
59+
python -m pip install build wheel setuptools
3660
python -m pip install -e .
3761
- name: Test package
3862
run: python -m unittest
@@ -73,16 +97,28 @@ jobs:
7397
name: python-dist
7498
path: dist
7599

100+
# ################ Release to GitHub
101+
76102
release:
77-
name: Create a new release
103+
name: Release to GitHub
78104
needs: build
79105
runs-on: ubuntu-latest
106+
permissions:
107+
contents: write
80108
steps:
81109
- name: Access package
82110
uses: actions/download-artifact@master
83111
with:
84112
name: python-dist
85113
path: dist
114+
- name: Rename package
115+
run: |
116+
cd "dist"
117+
oldname="$(find -type f -name "*.whl" -print -quit)"
118+
newname="${oldname/tableofcontents/toc}"
119+
cd ..
120+
mkdir gh
121+
cp "dist/$oldname" "gh/$newname"
86122
# https://raw.githubusercontent.com/orhun/git-cliff/main/.github/workflows/cd.yml
87123
- name: Create release
88124
uses: softprops/action-gh-release@master
@@ -93,9 +129,11 @@ jobs:
93129
token: ${{ github.token }}
94130
fail_on_unmatched_files: true
95131
files: |
96-
dist/*.whl
132+
gh/*.whl
97133
# other file
98134

135+
# ################ Deploy to PyPI
136+
99137
pypi:
100138
name: Deploy to PyPI
101139
needs: build
@@ -107,7 +145,7 @@ jobs:
107145
name: python-dist
108146
path: dist
109147
- name: Deploy package
110-
uses: pypa/gh-action-pypi-publish@master
148+
uses: pypa/gh-action-pypi-publish@unstable/v1
111149
with:
112150
user: __token__
113151
password: ${{ secrets.PYPI_API_TOKEN }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog for toc
1+
# Changelog - toc
22

33
## [2.1.0] - 2024-01-22
44
### Added

pyproject.toml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
# │ Contents of pyproject.toml │
33
# ├───────────────────────────────────────────────────────────────┘
44
#
5-
# ├── BUILD SYSTEM
6-
# ├── PROJECT
7-
# ├── TOOLS
5+
# ├── Build system
6+
# ├── Project
7+
# ├──┐Tools
8+
# │ └── Git-Cliff
89
#
910
# └───────────────────────────────────────────────────────────────
1011

11-
# ################################################################ BUILD SYSTEM
12+
# ################################################################ Build system
1213

1314
[build-system]
1415
requires = ["setuptools"]
1516
build-backend = "setuptools.build_meta"
1617

17-
[tool.setuptools.dynamic]
18-
readme = {file = ["README.md", "CHANGELOG.md"]}
19-
20-
# ################################################################ PROJECT
18+
# ################################################################ Project
2119

2220
[project]
2321
name = "tableofcontents"
@@ -26,8 +24,7 @@ authors = [
2624
{ name="AlphaJack" },
2725
]
2826
description = "Generate a table of contents from the comments of a file"
29-
#readme = "README.md"
30-
dynamic = ["readme"]
27+
readme = "README.md"
3128
requires-python = ">=3.10"
3229
classifiers = [
3330
"Development Status :: 5 - Production/Stable",
@@ -51,7 +48,9 @@ Issues = "https://github.com/AlphaJack/toc/issues"
5148
Repository = "https://github.com/AlphaJack/toc"
5249
Changelog = "https://github.com/AlphaJack/toc/blob/master/CHANGELOG.md"
5350

54-
# ################################################################ TOOLS
51+
# ################################################################ Tools
52+
53+
# ################################ Git-Cliff
5554

5655
[tool.git-cliff.git]
5756
conventional_commits = false
@@ -81,7 +80,7 @@ commit_parsers = [
8180

8281
[tool.git-cliff.changelog]
8382
trim = true
84-
header = """# Changelog for toc
83+
header = """# Changelog - toc
8584
8685
"""
8786
body = """

0 commit comments

Comments
 (0)