semtag 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- semtag-0.2.2/.github/workflows/publish.yml +128 -0
- {semtag-0.2.1/semtag.egg-info → semtag-0.2.2}/PKG-INFO +7 -1
- {semtag-0.2.1 → semtag-0.2.2}/README.md +6 -0
- semtag-0.2.2/requirements.txt +3 -0
- {semtag-0.2.1 → semtag-0.2.2/semtag.egg-info}/PKG-INFO +7 -1
- {semtag-0.2.1 → semtag-0.2.2}/tools/pre-commit +11 -3
- semtag-0.2.1/.github/workflows/publish.yml +0 -49
- semtag-0.2.1/requirements.txt +0 -1
- {semtag-0.2.1 → semtag-0.2.2}/.gitignore +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/LICENSE +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/SemanticVersion.py +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/pyproject.toml +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/semtag.egg-info/SOURCES.txt +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/semtag.egg-info/dependency_links.txt +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/semtag.egg-info/entry_points.txt +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/semtag.egg-info/requires.txt +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/semtag.egg-info/top_level.txt +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/semtag.py +0 -0
- {semtag-0.2.1 → semtag-0.2.2}/setup.cfg +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
- '[0-9]+.[0-9]+.[0-9]+'
|
|
8
|
+
- '[0-9]+.[0-9]+.[0-9]+-*'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-and-publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write # Required for creating GitHub releases
|
|
15
|
+
id-token: write # Required for trusted publishing
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0 # Required for setuptools_scm to get git history
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.x'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
pip install build twine
|
|
32
|
+
|
|
33
|
+
- name: Build package
|
|
34
|
+
run: python -m build
|
|
35
|
+
|
|
36
|
+
- name: Check package
|
|
37
|
+
run: twine check dist/*
|
|
38
|
+
|
|
39
|
+
# Use the official PyPI publish action
|
|
40
|
+
- name: Publish to PyPI
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
42
|
+
|
|
43
|
+
# GH Release
|
|
44
|
+
- name: Create GitHub Release
|
|
45
|
+
uses: softprops/action-gh-release@v1
|
|
46
|
+
with:
|
|
47
|
+
generate_release_notes: true
|
|
48
|
+
files: |
|
|
49
|
+
dist/*
|
|
50
|
+
|
|
51
|
+
### Homebrew tap update
|
|
52
|
+
update-homebrew-tap:
|
|
53
|
+
name: Update Homebrew tap
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
needs: build-and-publish
|
|
56
|
+
permissions:
|
|
57
|
+
contents: write
|
|
58
|
+
env:
|
|
59
|
+
FORMULA_PATH: tap/Formula/semtag.rb
|
|
60
|
+
TEMPLATE_PATH: tap/Templates/semtag.template
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout this repo
|
|
63
|
+
uses: actions/checkout@v4
|
|
64
|
+
with:
|
|
65
|
+
repository: mateuszmikrut/semtag
|
|
66
|
+
path: semtag
|
|
67
|
+
|
|
68
|
+
- name: Checkout tap repo
|
|
69
|
+
uses: actions/checkout@v4
|
|
70
|
+
with:
|
|
71
|
+
repository: mateuszmikrut/homebrew-tap
|
|
72
|
+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }} ## Add this to secrets
|
|
73
|
+
path: tap
|
|
74
|
+
|
|
75
|
+
- name: Create a branch for the update
|
|
76
|
+
working-directory: tap
|
|
77
|
+
run: |
|
|
78
|
+
set -euo pipefail
|
|
79
|
+
git checkout -b bump-semtag-"${GITHUB_REF_NAME}"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
- name: Update formula
|
|
83
|
+
# working-directory: semtag
|
|
84
|
+
run: |
|
|
85
|
+
set -euo pipefail
|
|
86
|
+
TAG="${GITHUB_REF_NAME}"
|
|
87
|
+
VERSION="${TAG#v}"
|
|
88
|
+
TARBALL_URL="https://github.com/mateuszmikrut/semtag/archive/refs/tags/${TAG}.tar.gz"
|
|
89
|
+
|
|
90
|
+
# Get tarball SHA
|
|
91
|
+
curl -sL "$TARBALL_URL" -o semtag.tar.gz
|
|
92
|
+
TARBALL_SHA=$(shasum -a 256 semtag.tar.gz | awk '{print $1}')
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
RESOURCES=""
|
|
96
|
+
for pkg in $(grep -vE '^#|^$' semtag/requirements.txt ); do
|
|
97
|
+
name=$(echo "$pkg" | sed 's/[>=<].*//')
|
|
98
|
+
version=$(echo "$pkg" | sed 's/.*[>=]=//; s/[<>=].*//')
|
|
99
|
+
|
|
100
|
+
pypi_url="https://pypi.org/pypi/${name}/${version}/json"
|
|
101
|
+
response=$(curl -s "$pypi_url" | tr -d '\r')
|
|
102
|
+
|
|
103
|
+
if ! echo "$response" | jq empty 2>/dev/null; then
|
|
104
|
+
echo "ERROR: Failed to parse PyPI response for $pkg $version" >&2
|
|
105
|
+
continue
|
|
106
|
+
fi
|
|
107
|
+
url=$(echo "$response" | jq -r '.urls[] | select(.packagetype=="sdist") | .url' | head -1)
|
|
108
|
+
sha=$(echo "$response" | jq -r '.urls[] | select(.packagetype=="sdist") | .digests.sha256' | head -1)
|
|
109
|
+
|
|
110
|
+
RESOURCES="$(printf "%s%s\n resource \"%s\" do\n url \"%s\"\n sha256 \"%s\"\n end\n\n" "$RESOURCES" "" "$name" "$url" "$sha")"
|
|
111
|
+
done
|
|
112
|
+
export RESOURCES
|
|
113
|
+
|
|
114
|
+
envsubst < "${{ env.TEMPLATE_PATH }}" > "${{ env.FORMULA_PATH }}"
|
|
115
|
+
|
|
116
|
+
- name: Commit and push changes
|
|
117
|
+
run: |
|
|
118
|
+
set -euo pipefail
|
|
119
|
+
git status --short
|
|
120
|
+
if git diff --quiet; then
|
|
121
|
+
echo "No changes to commit"
|
|
122
|
+
exit 0
|
|
123
|
+
fi
|
|
124
|
+
git config user.name "github-actions[bot]"
|
|
125
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
126
|
+
git add "${FORMULA_PATH}"
|
|
127
|
+
git commit -m "Update semtag to ${GITHUB_REF_NAME}"
|
|
128
|
+
git push
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: semtag
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A tool for managing semantic version tags in git repositories
|
|
5
5
|
Author-email: Mateusz Mikrut <mateusz.mikrut@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -74,6 +74,12 @@ Using pip (preferred)
|
|
|
74
74
|
pip install semtag
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
Using Homebrew
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
brew install mateuszmikrut/tap/semtag
|
|
81
|
+
```
|
|
82
|
+
|
|
77
83
|
From git
|
|
78
84
|
```bash
|
|
79
85
|
git clone https://github.com/mateuszmikrut/semtag.git
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: semtag
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A tool for managing semantic version tags in git repositories
|
|
5
5
|
Author-email: Mateusz Mikrut <mateusz.mikrut@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -74,6 +74,12 @@ Using pip (preferred)
|
|
|
74
74
|
pip install semtag
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
Using Homebrew
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
brew install mateuszmikrut/tap/semtag
|
|
81
|
+
```
|
|
82
|
+
|
|
77
83
|
From git
|
|
78
84
|
```bash
|
|
79
85
|
git clone https://github.com/mateuszmikrut/semtag.git
|
|
@@ -2,19 +2,27 @@
|
|
|
2
2
|
# Pre-commit hook to generate README.md options from script argparse help
|
|
3
3
|
|
|
4
4
|
### Install pre-commit hook:
|
|
5
|
-
# ln -s
|
|
5
|
+
# ln -s ../../tools/pre-commit .git/hooks/pre-commit
|
|
6
6
|
|
|
7
7
|
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
8
8
|
|
|
9
9
|
# Check if semtag.py has been modified
|
|
10
|
-
|
|
10
|
+
echo "Pre-commit hook running..."
|
|
11
|
+
if git diff --cached --name-only | grep -q semtag.py; then
|
|
11
12
|
echo "Updating README.md options..."
|
|
12
13
|
cd "$REPO_ROOT" || exit 1
|
|
13
14
|
|
|
14
15
|
OPTIONS_TMP=$(mktemp)
|
|
15
16
|
README_TMP=$(mktemp)
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
# Prefer virtual environment python if exists
|
|
19
|
+
if [ -d venv ];then
|
|
20
|
+
PYPATH="$REPO_ROOT/venv/bin/python"
|
|
21
|
+
else
|
|
22
|
+
PYPATH="python3"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
$PYPATH semtag.py --help 2>&1 | sed -n '/^options:/,/^$/p' | tail -n +2 > "$OPTIONS_TMP"
|
|
18
26
|
|
|
19
27
|
# README with updated options
|
|
20
28
|
awk -v opts_file="$OPTIONS_TMP" '
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
name: Publish to PyPI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
- '[0-9]+.[0-9]+.[0-9]+'
|
|
8
|
-
- '[0-9]+.[0-9]+.[0-9]+-*'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build-and-publish:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write # Required for creating GitHub releases
|
|
15
|
-
id-token: write # Required for trusted publishing
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout code
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
with:
|
|
21
|
-
fetch-depth: 0 # Required for setuptools_scm to get git history
|
|
22
|
-
|
|
23
|
-
- name: Set up Python
|
|
24
|
-
uses: actions/setup-python@v5
|
|
25
|
-
with:
|
|
26
|
-
python-version: '3.x'
|
|
27
|
-
|
|
28
|
-
- name: Install dependencies
|
|
29
|
-
run: |
|
|
30
|
-
python -m pip install --upgrade pip
|
|
31
|
-
pip install build twine
|
|
32
|
-
|
|
33
|
-
- name: Build package
|
|
34
|
-
run: python -m build
|
|
35
|
-
|
|
36
|
-
- name: Check package
|
|
37
|
-
run: twine check dist/*
|
|
38
|
-
|
|
39
|
-
# Use the official PyPI publish action
|
|
40
|
-
- name: Publish to PyPI
|
|
41
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
|
42
|
-
|
|
43
|
-
# GH Release
|
|
44
|
-
- name: Create GitHub Release
|
|
45
|
-
uses: softprops/action-gh-release@v1
|
|
46
|
-
with:
|
|
47
|
-
generate_release_notes: true
|
|
48
|
-
files: |
|
|
49
|
-
dist/*
|
semtag-0.2.1/requirements.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
gitpython>=3.1.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|