Switch from Woodpecker CI to Forgejo Actions
All checks were successful
Run tests / test-precommit (push) Successful in 1m3s
All checks were successful
Run tests / test-precommit (push) Successful in 1m3s
This commit is contained in:
parent
f4f87fccd3
commit
32ced674a4
3 changed files with 104 additions and 68 deletions
89
.forgejo/workflows/release.yaml
Normal file
89
.forgejo/workflows/release.yaml
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
---
|
||||||
|
name: Build and publish Debian package
|
||||||
|
on: [create]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/debian-python-deb:latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Build Debian package
|
||||||
|
env:
|
||||||
|
MAINTAINER_NAME: ${{ vars.MAINTAINER_NAME }}
|
||||||
|
MAINTAINER_EMAIL: ${{ vars.MAINTAINER_EMAIL }}
|
||||||
|
DEBIAN_CODENAME: ${{ vars.DEBIAN_CODENAME }}
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.GPG_KEY }}"|base64 -d|gpg --import
|
||||||
|
./build.sh
|
||||||
|
mv check_slapdd_crc32 dist/
|
||||||
|
- name: Upload Debian package files
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: |
|
||||||
|
dist/*.buildinfo
|
||||||
|
dist/*.changes
|
||||||
|
dist/*.deb
|
||||||
|
dist/*.dsc
|
||||||
|
dist/*.tar.gz
|
||||||
|
dist/release_notes.md
|
||||||
|
dist/check_slapdd_crc32
|
||||||
|
|
||||||
|
publish-forgejo:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/debian-python-deb:latest
|
||||||
|
steps:
|
||||||
|
- name: Download Debian package files
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
|
||||||
|
- name: Create the release
|
||||||
|
id: create-release
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir release
|
||||||
|
mv *.deb release/
|
||||||
|
mv check_slapdd_crc32 release/
|
||||||
|
md5sum release/* > md5sum.txt
|
||||||
|
sha512sum release/* > sha512sum.txt
|
||||||
|
mv md5sum.txt sha512sum.txt release/
|
||||||
|
{
|
||||||
|
echo 'release_note<<EOF'
|
||||||
|
cat release_notes.md
|
||||||
|
echo 'EOF'
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Publish release on Forgejo
|
||||||
|
uses: actions/forgejo-release@v1
|
||||||
|
with:
|
||||||
|
direction: upload
|
||||||
|
url: https://gitea.zionetrix.net
|
||||||
|
token: ${{ secrets.forgejo_token }}
|
||||||
|
release-dir: release
|
||||||
|
release-notes: ${{ steps.create-release.outputs.release_note }}
|
||||||
|
|
||||||
|
publish-aptly:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/aptly-publish:latest
|
||||||
|
steps:
|
||||||
|
- name: "Download Debian package files"
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
|
||||||
|
- name: "Publish Debian package on Aptly repository"
|
||||||
|
uses: https://gitea.zionetrix.net/bn8/aptly-publish@master
|
||||||
|
with:
|
||||||
|
api_url: ${{ vars.apt_api_url }}
|
||||||
|
api_username: ${{ vars.apt_api_username }}
|
||||||
|
api_password: ${{ secrets.apt_api_password }}
|
||||||
|
repo_name: ${{ vars.apt_repo_name }}
|
||||||
|
path: "./"
|
||||||
|
source_name: ${{ vars.apt_source_name }}
|
15
.forgejo/workflows/tests.yaml
Normal file
15
.forgejo/workflows/tests.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
name: Run tests
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
test-precommit:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/python-pre-commit:latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Run pre-commit
|
||||||
|
run: pre-commit run --all-files
|
|
@ -1,68 +0,0 @@
|
||||||
clone:
|
|
||||||
git:
|
|
||||||
image: woodpeckerci/plugin-git
|
|
||||||
tags: true
|
|
||||||
|
|
||||||
pipeline:
|
|
||||||
test-pylint:
|
|
||||||
group: test
|
|
||||||
image: pipelinecomponents/pylint
|
|
||||||
commands:
|
|
||||||
- pylint check_slapdd_crc32
|
|
||||||
|
|
||||||
test-flake8:
|
|
||||||
group: test
|
|
||||||
image: pipelinecomponents/flake8
|
|
||||||
commands:
|
|
||||||
- flake8 check_slapdd_crc32
|
|
||||||
|
|
||||||
build:
|
|
||||||
image: brenard/debian-python-deb
|
|
||||||
when:
|
|
||||||
event: tag
|
|
||||||
commands:
|
|
||||||
- echo "$GPG_KEY"|base64 -d|gpg --import
|
|
||||||
- ./build.sh --quiet
|
|
||||||
secrets: [maintainer_name, maintainer_email, gpg_key, debian_codename]
|
|
||||||
|
|
||||||
publish-dryrun:
|
|
||||||
group: publish
|
|
||||||
image: alpine
|
|
||||||
when:
|
|
||||||
event: tag
|
|
||||||
commands:
|
|
||||||
- ls dist/* dist/check-slapdd-crc32-*/check_slapdd_crc32
|
|
||||||
|
|
||||||
publish-gitea:
|
|
||||||
group: publish
|
|
||||||
image: plugins/gitea-release
|
|
||||||
when:
|
|
||||||
event: tag
|
|
||||||
settings:
|
|
||||||
api_key:
|
|
||||||
from_secret: gitea_token
|
|
||||||
base_url: https://gitea.zionetrix.net
|
|
||||||
note: dist/release_notes.md
|
|
||||||
files:
|
|
||||||
- dist/check-slapdd-crc32-*/check_slapdd_crc32
|
|
||||||
- dist/*.deb
|
|
||||||
checksum:
|
|
||||||
- md5
|
|
||||||
- sha512
|
|
||||||
|
|
||||||
publish-apt:
|
|
||||||
group: publish
|
|
||||||
image: brenard/aptly-publish
|
|
||||||
when:
|
|
||||||
event: tag
|
|
||||||
settings:
|
|
||||||
api_url:
|
|
||||||
from_secret: apt_api_url
|
|
||||||
api_username:
|
|
||||||
from_secret: apt_api_username
|
|
||||||
api_password:
|
|
||||||
from_secret: apt_api_password
|
|
||||||
repo_name:
|
|
||||||
from_secret: apt_repo_name
|
|
||||||
path: dist
|
|
||||||
source_name: check-slapdd-crc32
|
|
Loading…
Reference in a new issue