72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
jobs:
|
|
build_pip_package:
|
|
name: "Build Pip package"
|
|
runs-on: woryzen
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
cache: 'pip'
|
|
- name: Create virtualenv
|
|
run: |
|
|
python -m venv .venv
|
|
.venv/bin/pip install -r requirements-dev.txt
|
|
- name: Execute build
|
|
run: |
|
|
.venv/bin/python -m build
|
|
- name: Publish artifacts
|
|
env:
|
|
TWINE_REPOSITORY_URL: ${{ vars.PYPI_REGISTRY_URL }}
|
|
TWINE_USERNAME: ${{ vars.PUBLISHER_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.PUBLISHER_TOKEN }}
|
|
run: |
|
|
.venv/bin/python -m twine upload --repository gitea dist/*{.whl,tar.gz}
|
|
build_docker_image:
|
|
name: "Build Docker image"
|
|
runs-on: woryzen
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
- name: Get package version
|
|
run: |
|
|
echo VERSION=$(python -m setuptools_scm) >> "$GITHUB_ENV"
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3.4.0
|
|
with:
|
|
driver: docker-container
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm64
|
|
- name: Login to Gitea container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.woggioni.net
|
|
username: woggioni
|
|
password: ${{ secrets.PUBLISHER_TOKEN }}
|
|
- name: Build and push bugis images
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm64
|
|
push: true
|
|
pull: true
|
|
tags: |
|
|
"gitea.woggioni.net/woggioni/bugis:latest"
|
|
"gitea.woggioni.net/woggioni/bugis:${{ env.VERSION }}"
|
|
cache-from: type=registry,ref=gitea.woggioni.net/woggioni/bugis:buildx
|
|
cache-to: type=registry,mode=max,compression=zstd,image-manifest=true,oci-mediatypes=true,ref=gitea.woggioni.net/woggioni/bugis:buildx
|