-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: - self-test workflow - base.in and test.in requirements - pip-tools configuration file remove: - commitizen configuration and CHANGELOG - pr-build workflow - virtualenv.in requirements (switching to venv)
- Loading branch information
1 parent
9b063ed
commit 4cdf82a
Showing
15 changed files
with
387 additions
and
160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,53 @@ | ||
name: publish | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- 'coatl' | ||
paths: | ||
- '.github/workflows/publish.yml' | ||
- 'Dockerfile' | ||
schedule: | ||
- cron: '30 20 * * 1,5' | ||
|
||
jobs: | ||
build: | ||
semver: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.tags.outputs.version }} | ||
major_minor: ${{ steps.tags.outputs.major_minor }} | ||
major: ${{ steps.tags.outputs.major }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
coatldev/devpi | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Extract version number | ||
id: tags | ||
run: | | ||
# Extract the Python version from the Dockerfile | ||
VERSION=$(grep -oP 'devpi-server==\K[0-9]+\.[0-9]+\.[0-9]+' requirements/devpi.txt) | ||
echo "VERSION=${VERSION}" | ||
# Trim the version to the first two segments (major.minor) | ||
MAJOR_MINOR=$(echo "$VERSION" | grep -oP '[0-9]+\.[0-9]+') | ||
echo "MAJOR_MINOR=${MAJOR_MINOR}" | ||
# Trim the version to the first segment (major) | ||
MAJOR=$(echo "$MAJOR_MINOR" | grep -oP '^[0-9]+') | ||
echo "MAJOR=${MAJOR}" | ||
# Export the extracted version to GITHUB_OUTPUT | ||
echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
echo "major_minor=${MAJOR_MINOR}" >> $GITHUB_OUTPUT | ||
echo "major=${MAJOR}" >> $GITHUB_OUTPUT | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
publish: | ||
needs: semver | ||
uses: coatl-dev/workflows/.github/workflows/docker-publish-multi-platform.yml@v4 | ||
with: | ||
registry-image: coatldev/six | ||
metadata-tags: | | ||
type=raw,value=${{ needs.semver.outputs.version }} | ||
type=raw,value=${{ needs.semver.outputs.major_minor }} | ||
type=raw,value=${{ needs.semver.outputs.major }} | ||
dockerhub-username: ${{ vars.DOCKERHUB_USERNAME }} | ||
secrets: | ||
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: self-test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
devpi-password: abcd1234 | ||
devpi-username: root | ||
devpi-port: 3141 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build container | ||
run: | | ||
docker build -t devpi . | ||
- name: Run container | ||
run: | | ||
docker run docker run \ | ||
--name devpi-server \ | ||
--detach \ | ||
--publish 3141:3141 \ | ||
--env DEVPI_PASSWORD=${{ env.devpi-password }} \ | ||
devpi | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
id: setup-python | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Cache Python | ||
id: cache-python | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.setup-python.outputs.python-path }} | ||
key: py-${{ steps.setup-python.outputs.python-version }}-${{ runner.os }}-${{ hashFiles('requirements/test.txt') }} | ||
|
||
- name: Install requirements | ||
run: | | ||
python -m pip install --requirement requirements/test.txt | ||
- name: Create the stub package importable directory | ||
run: mkdir -pv src/test_package | ||
- name: Populate the stub package `__init__.py` | ||
run: echo '__version__ = "0.1"' > src/test_package/__init__.py | ||
- name: Populate the stub package `README.md` | ||
run: echo "# Test Package" > README.md | ||
- name: Populate the stub package `pyproject.toml` | ||
run: echo "$CONTENTS" > pyproject.toml | ||
env: | ||
CONTENTS: | | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools>=61.2", | ||
] | ||
[project] | ||
name = "test-package" | ||
version = "0.1" | ||
readme = "README.md" | ||
- name: Build the stub package | ||
run: | | ||
python -m build | ||
- name: Upload package | ||
run: | | ||
python -m twine upload --verbose dist/* | ||
env: | ||
TWINE_USERNAME: ${{ env.devpi-username }} | ||
TWINE_PASSWORD: ${{ env.devpi-password }} | ||
TWINE_REPOSITORY_URL: http://localhost:${{ env.devpi-port }}/${{ env.devpi-username }}/public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[tool.pip-tools] | ||
allow-unsafe = true | ||
generate-hashes = true | ||
resolver = "backtracking" | ||
strip-extras = false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pip | ||
setuptools | ||
wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --allow-unsafe --config=../.pip-tools.toml --generate-hashes base.in | ||
# | ||
wheel==0.43.0 \ | ||
--hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ | ||
--hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 | ||
# via -r base.in | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
pip==24.1.2 \ | ||
--hash=sha256:7cd207eed4c60b0f411b444cd1464198fe186671c323b6cd6d433ed80fc9d247 \ | ||
--hash=sha256:e5458a0b89f2755e0ee8c0c77613fe5273e05f337907874d64f13171a898a7ff | ||
# via -r base.in | ||
setuptools==71.0.3 \ | ||
--hash=sha256:3d8531791a27056f4a38cd3e54084d8b1c4228ff9cf3f2d7dd075ec99f9fd70d \ | ||
--hash=sha256:f501b6e6db709818dc76882582d9c516bf3b67b948864c5fa1d1624c09a49207 | ||
# via -r base.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build | ||
twine |
Oops, something went wrong.