feat: migrate from woodpecker to forgejo actions
This commit is contained in:
parent
5f8653797f
commit
5e52dffc27
6 changed files with 78 additions and 98 deletions
38
.forgejo/workflows/package.yml
Normal file
38
.forgejo/workflows/package.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
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
|
||||||
|
- uses: https://git.kabelsalat.ch/s3lph/forgejo-action-python-debian-package@v5
|
||||||
|
with:
|
||||||
|
python_module: icalendar_timeseries_server
|
||||||
|
package_name: icalendar-timeseries-server
|
||||||
|
package_root: package/debian/icalendar-timeseries-server
|
||||||
|
package_output_path: package/debian
|
||||||
|
- 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"
|
27
.forgejo/workflows/test.yml
Normal file
27
.forgejo/workflows/test.yml
Normal file
|
@ -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 icalendar_timeseries_server
|
||||||
|
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 icalendar_timeseries_server
|
|
@ -1,95 +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 icalendar_timeseries_server
|
|
||||||
|
|
||||||
codestyle:
|
|
||||||
image: python:3.11-bookworm
|
|
||||||
group: test
|
|
||||||
commands:
|
|
||||||
- pip3 install -e .[test]
|
|
||||||
- pycodestyle icalendar_timeseries_server
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
image: python:3.11-bookworm
|
|
||||||
group: integration
|
|
||||||
commands:
|
|
||||||
- pip3 install -e .[test]
|
|
||||||
- python3 -m coverage combine
|
|
||||||
- python3 -m coverage report --rcfile=setup.cfg
|
|
||||||
|
|
||||||
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 <<EOF
|
|
||||||
[distutils]
|
|
||||||
index-servers = gitea
|
|
||||||
|
|
||||||
[gitea]
|
|
||||||
repository = $${GITEA_API_REPOSITORY_PYPI}
|
|
||||||
username = $${GITEA_API_USERNAME}
|
|
||||||
password = $${GITEA_API_PASSWORD}
|
|
||||||
EOF
|
|
||||||
- python3 -m twine upload --repository gitea dist/*.whl
|
|
||||||
|
|
||||||
build_debian:
|
|
||||||
image: python:3.11-bookworm
|
|
||||||
group: package
|
|
||||||
when:
|
|
||||||
- event: tag
|
|
||||||
secrets:
|
|
||||||
- GITEA_API_REPOSITORY_DEB
|
|
||||||
- GITEA_API_USERNAME
|
|
||||||
- GITEA_API_PASSWORD
|
|
||||||
commands:
|
|
||||||
- apt update; apt install -y lintian rsync sudo curl
|
|
||||||
- export ITS_VERSION=$(python -c 'import icalendar_timeseries_server; print(icalendar_timeseries_server.__version__)')
|
|
||||||
- |
|
|
||||||
(for version in $(cat CHANGELOG.md | grep '<!-- BEGIN CHANGES' | cut -d ' ' -f 4); do
|
|
||||||
echo -e "icalendar-timeseries-server ($${version}-1) stable; urgency=medium\n"
|
|
||||||
cat CHANGELOG.md | grep -A 1000 "<"'!'"-- BEGIN CHANGES $${version} -->" | grep -B 1000 "<"'!'"-- END CHANGES $${version} -->" | tail -n +2 | head -n -1 | sed -re 's/^-/ */g'
|
|
||||||
echo -e "\n -- s3lph <s3lph@kabelsalat.ch> $(date -R)\n"
|
|
||||||
done) > package/debian/icalendar-timeseries-server/usr/share/doc/icalendar-timeseries-server/changelog
|
|
||||||
- gzip -9n package/debian/icalendar-timeseries-server/usr/share/doc/icalendar-timeseries-server/changelog
|
|
||||||
- python3 setup.py egg_info install --root=package/debian/icalendar-timeseries-server/ --prefix=/usr --optimize=1
|
|
||||||
- cd package/debian
|
|
||||||
- sed -re "s/__ITS_VERSION__/$${ITS_VERSION}/g" -i icalendar-timeseries-server/DEBIAN/control
|
|
||||||
- mkdir -p icalendar-timeseries-server/usr/lib/python3/dist-packages/
|
|
||||||
- rsync -a icalendar-timeseries-server/usr/lib/python3.11/site-packages/ icalendar-timeseries-server/usr/lib/python3/dist-packages/
|
|
||||||
- rm -rf icalendar-timeseries-server/usr/lib/python3.11/site-packages
|
|
||||||
- find icalendar-timeseries-server/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true
|
|
||||||
- find icalendar-timeseries-server/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \;
|
|
||||||
- find icalendar-timeseries-server/usr/lib/python3/dist-packages -name '*.pyo' -exec rm {} \;
|
|
||||||
- sed -re 's$#!/usr/local/bin/python3$#!/usr/bin/python3$' -i icalendar-timeseries-server/usr/bin/icalendar-timeseries-server
|
|
||||||
- find icalendar-timeseries-server -type f -exec chmod 0644 {} \;
|
|
||||||
- find icalendar-timeseries-server -type d -exec chmod 755 {} \;
|
|
||||||
- >-
|
|
||||||
chmod +x
|
|
||||||
icalendar-timeseries-server/usr/bin/icalendar-timeseries-server
|
|
||||||
icalendar-timeseries-server/DEBIAN/postinst
|
|
||||||
icalendar-timeseries-server/DEBIAN/prerm
|
|
||||||
icalendar-timeseries-server/DEBIAN/postrm
|
|
||||||
- dpkg-deb --build icalendar-timeseries-server
|
|
||||||
- mv icalendar-timeseries-server.deb "icalendar-timeseries-server_$${ITS_VERSION}-1_all.deb"
|
|
||||||
- sudo -u nobody lintian "icalendar-timeseries-server_$${ITS_VERSION}-1_all.deb" || true
|
|
||||||
- >-
|
|
||||||
curl
|
|
||||||
--user "$${GITEA_API_USERNAME}:$${GITEA_API_PASSWORD}"
|
|
||||||
--upload-file "icalendar-timeseries-server_$${ITS_VERSION}-1_all.deb"
|
|
||||||
$${GITEA_API_REPOSITORY_DEB}
|
|
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,6 +1,17 @@
|
||||||
# iCalendar Timeseries Server Changelog
|
# iCalendar Timeseries Server Changelog
|
||||||
|
|
||||||
|
|
||||||
|
<!-- BEGIN RELEASE v0.6.3 -->
|
||||||
|
## Version 0.6.3
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
<!-- BEGIN CHANGES 0.6.3 -->
|
||||||
|
- Migration from Woodpecker to Forgejo Actions.
|
||||||
|
<!-- END CHANGES 0.6.3 -->
|
||||||
|
|
||||||
|
<!-- END RELEASE v0.6.3 -->
|
||||||
|
|
||||||
<!-- BEGIN RELEASE v0.6.2 -->
|
<!-- BEGIN RELEASE v0.6.2 -->
|
||||||
## Version 0.6.2
|
## Version 0.6.2
|
||||||
|
|
||||||
|
@ -8,7 +19,6 @@
|
||||||
|
|
||||||
<!-- BEGIN CHANGES 0.6.2 -->
|
<!-- BEGIN CHANGES 0.6.2 -->
|
||||||
- Migration from Gitlab-CI to Woodpecker
|
- Migration from Gitlab-CI to Woodpecker
|
||||||
|
|
||||||
<!-- END CHANGES 0.6.2 -->
|
<!-- END CHANGES 0.6.2 -->
|
||||||
|
|
||||||
<!-- END RELEASE v0.6.2 -->
|
<!-- END RELEASE v0.6.2 -->
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
|
|
||||||
__version__ = '0.6.2'
|
__version__ = '0.6.3'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Package: icalendar-timeseries-server
|
Package: icalendar-timeseries-server
|
||||||
Version: __ITS_VERSION__
|
Version: __VERSION__
|
||||||
Maintainer: s3lph <s3lph@kabelsalat.ch>
|
Maintainer: s3lph <s3lph@kabelsalat.ch>
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
|
|
Loading…
Reference in a new issue