diff --git a/.forgejo/workflows/package.yml b/.forgejo/workflows/package.yml new file mode 100644 index 0000000..ee05021 --- /dev/null +++ b/.forgejo/workflows/package.yml @@ -0,0 +1,52 @@ +--- + +on: + push: + tags: + - "v*" + +jobs: + + build_wheel: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Build Python wheel + run: | + apt update; apt install -y python3-pip + pip3 install --break-system-packages -e .[test] + python3 setup.py egg_info bdist_wheel + - uses: https://git.kabelsalat.ch/s3lph/forgejo-action-wheel-package-upload@v3 + with: + username: ${{ secrets.API_USERNAME }} + password: ${{ secrets.API_PASSWORD }} + + build_debian: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Prepare package + run: | + # The Python package name provided by the python3-magic Debian package is "python-magic" rather than "file-magic". + sed -re 's/file-magic/python-magic/' -i setup.py + cp -r static/ package/debian/matemat/usr/lib/matemat/static/ + cp -r templates/ package/debian/matemat/usr/lib/matemat/templates/ + mkdir -p package/debian/matemat/var/lib/matemat/themes/ + cp -r themes/ package/debian/matemat/usr/lib/matemat/themes/ + + - uses: https://git.kabelsalat.ch/s3lph/forgejo-action-python-debian-package@v5 + with: + python_module: matemat + package_name: matemat + package_root: package/debian/matemat + package_output_path: package/debian + pre_package_hook: | + mv matemat/usr/bin/matemat matemat/usr/lib/matemat/matemat + rm -rf matemat/usr/bin + chmod +x matemat/usr/lib/matemat/matemat + + - uses: https://git.kabelsalat.ch/s3lph/forgejo-action-debian-package-upload@v2 + with: + username: ${{ secrets.API_USERNAME }} + password: ${{ secrets.API_PASSWORD }} + deb: "package/debian/*.deb" diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..d60c3d7 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,27 @@ +--- + +on: push + +jobs: + + test: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: test + run: | + apt update; apt install --yes python3-pip + pip3 install --break-system-packages -e .[test] + python3 -m coverage run --rcfile=setup.cfg -m unittest discover matemat + python3 -m coverage combine + python3 -m coverage report --rcfile=setup.cfg + + codestyle: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: codestyle + run: | + apt update; apt install --yes python3-pip + pip3 install --break-system-packages -e .[test] + pycodestyle matemat diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index d31880c..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- - -steps: - - test: - image: python:3.11-bookworm - group: test - commands: - - pip3 install -e .[test] - - python3 -m coverage run --rcfile=setup.cfg -m unittest discover matemat - - python3 -m coverage combine - - python3 -m coverage report --rcfile=setup.cfg - - codestyle: - image: python:3.11-bookworm - group: test - commands: - - pip3 install -e .[test] - - pycodestyle matemat - - build_wheel: - image: python:3.11-bookworm - group: package - when: - - event: tag - secrets: - - GITEA_API_REPOSITORY_PYPI - - GITEA_API_USERNAME - - GITEA_API_PASSWORD - commands: - - pip3 install -e .[test] - - python3 setup.py egg_info bdist_wheel - - | - cat > ~/.pypirc <" | grep -B 1000 "<"'!'"-- END CHANGES $${version} -->" | tail -n +2 | head -n -1 | sed -re 's/^-/ */g' - echo "\n -- s3lph@kabelsalat.ch $(date -R)\n" - done) > package/debian/matemat/usr/share/doc/matemat/changelog - - gzip -9n package/debian/matemat/usr/share/doc/matemat/changelog - - cp -r static/ package/debian/matemat/usr/lib/matemat/static/ - - cp -r templates/ package/debian/matemat/usr/lib/matemat/templates/ - - mkdir -p package/debian/matemat/var/lib/matemat/themes/ - - cp -r themes/ package/debian/matemat/usr/lib/matemat/themes/ - - python3 setup.py egg_info install --root=package/debian/matemat/ --prefix=/usr --optimize=1 - - cd package/debian - - mkdir -p matemat/usr/lib/python3/dist-packages/ - - rsync -a matemat/usr/lib/python3.11/site-packages/ matemat/usr/lib/python3/dist-packages/ - - rm -rf matemat/usr/lib/python3.11/ - - find matemat/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true - - find matemat/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \; - - mv matemat/usr/bin/matemat matemat/usr/lib/matemat/matemat - - rm -rf matemat/usr/bin - - sed -re 's$#!/usr/local/bin/python3$#!/usr/bin/python3$' -i matemat/usr/lib/matemat/matemat - - find matemat -type f -exec chmod 0644 {} \; - - find matemat -type d -exec chmod 755 {} \; - - chmod +x matemat/usr/lib/matemat/matemat matemat/DEBIAN/postinst matemat/DEBIAN/prerm matemat/DEBIAN/postrm - - sed -re "s/__VERSION__/$${MATEMAT_VERSION}-1/g" -i matemat/DEBIAN/control - - dpkg-deb --build matemat - - mv matemat.deb "matemat_$${MATEMAT_VERSION}-1_all.deb" - - sudo -u nobody lintian "matemat_$${MATEMAT_VERSION}-1_all.deb" || true - - >- - curl - --user "$${GITEA_API_USERNAME}:$${GITEA_API_PASSWORD}" - --upload-file "matemat_$${MATEMAT_VERSION}-1_all.deb" - $${GITEA_API_REPOSITORY_DEB} diff --git a/CHANGELOG.md b/CHANGELOG.md index eba7c9f..7852db7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Matemat Changelog + +## Version 0.3.8 + +Migrate from Woodpecker CI to Forgejo Actions + +### Changes + + +- Migrate from Woodpecker CI to Forgejo Actions + + + + ## Version 0.3.7 diff --git a/README.md b/README.md index 5d2e718..bf76ac9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Matemat -[![status-badge](https://woodpecker.kabelsalat.ch/api/badges/80/status.svg)](https://woodpecker.kabelsalat.ch/repos/80) - A web service for automated stock-keeping of a soda machine written in Python. It provides a touch-input-friendly user interface (as most input happens through the soda machine's touch screen). diff --git a/matemat/__init__.py b/matemat/__init__.py index 645fb47..54008c2 100644 --- a/matemat/__init__.py +++ b/matemat/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.3.7' +__version__ = '0.3.8'