This commit is contained in:
parent
1c89a509a3
commit
66d9d2dc09
1 changed files with 70 additions and 0 deletions
70
.forgejo/workflows/build.yaml
Normal file
70
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,70 @@
|
|||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
verbose:
|
||||
description: "Verbose"
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: container
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
with:
|
||||
version: "0.5.16"
|
||||
|
||||
- name: Install
|
||||
run: uv sync
|
||||
|
||||
- name: Run tests (API call)
|
||||
run: .venv/bin/pytest -s tests/basic.py
|
||||
|
||||
- name: Build wheel
|
||||
run: uv build --wheel
|
||||
|
||||
- name: Publish Python package (home)
|
||||
env:
|
||||
LOCAL_PYPI_TOKEN: ${{ secrets.LOCAL_PYPI_TOKEN }}
|
||||
run: uv publish --publish-url https://code.philo.ydns.eu/api/packages/philorg/pypi --token $LOCAL_PYPI_TOKEN
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: echo "version=$(.venv/bin/oidc-test --version)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Workaround for bug of podman-login
|
||||
run: |
|
||||
mkdir -p $HOME/.docker
|
||||
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
|
||||
|
||||
- name: Log in to the container registry (with another workaround)
|
||||
uses: actions/podman-login@v1
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
auth_file_path: /tmp/auth.json
|
||||
|
||||
- name: Build the container image
|
||||
uses: actions/buildah-build@v1
|
||||
with:
|
||||
image: oidc-fastapi-test
|
||||
oci: true
|
||||
labels: oidc-fastapi-test
|
||||
tags: latest ${{ steps.version.outputs.version }}
|
||||
containerfiles: |
|
||||
./Containerfile
|
||||
|
||||
- name: Push the image to the registry
|
||||
uses: actions/push-to-registry@v2
|
||||
with:
|
||||
registry: "docker://${{ vars.REGISTRY }}/${{ vars.ORGANISATION }}"
|
||||
image: oidc-fastapi-test
|
||||
tags: latest ${{ steps.version.outputs.version }}
|
Loading…
Add table
Add a link
Reference in a new issue