This commit is contained in:
parent
c06e45029d
commit
746221d13d
4 changed files with 88 additions and 28 deletions
|
@ -9,7 +9,7 @@ on:
|
|||
type: boolean
|
||||
|
||||
jobs:
|
||||
test:
|
||||
build:
|
||||
runs-on: container
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -19,29 +19,31 @@ jobs:
|
|||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
with:
|
||||
version: "0.5.10"
|
||||
version: "0.6.6"
|
||||
|
||||
- name: Install
|
||||
run: uv sync
|
||||
|
||||
- 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/tinyseady-mailer --version)" >> $GITHUB_OUTPUT
|
||||
run: echo "VERSION=$(.venv/bin/dunamai from any --style semver)" >> $GITHUB_ENV
|
||||
|
||||
- name: Version
|
||||
run: echo $VERSION
|
||||
|
||||
- name: Get distance from tag
|
||||
run: echo "DISTANCE=$(.venv/bin/dunamai from any --format '{distance}')" >> $GITHUB_ENV
|
||||
|
||||
- name: Distance
|
||||
run: echo $DISTANCE
|
||||
|
||||
- name: Workaround for bug of podman-login
|
||||
if: env.DISTANCE == '0'
|
||||
run: |
|
||||
mkdir -p $HOME/.docker
|
||||
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
|
||||
|
||||
- name: Log in to the container registry (with another workaround)
|
||||
if: env.DISTANCE == '0'
|
||||
uses: actions/podman-login@v1
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY }}
|
||||
|
@ -50,18 +52,31 @@ jobs:
|
|||
auth_file_path: /tmp/auth.json
|
||||
|
||||
- name: Build the container image
|
||||
if: env.DISTANCE == '0'
|
||||
uses: actions/buildah-build@v1
|
||||
with:
|
||||
image: tinyseady-mailer
|
||||
image: tinysteady-mailer
|
||||
oci: true
|
||||
labels: tinyseady-mailer
|
||||
tags: latest ${{ steps.version.outputs.version }}
|
||||
labels: tinysteady-mailer
|
||||
tags: "latest ${{ env.VERSION }}"
|
||||
containerfiles: |
|
||||
./Containerfile
|
||||
|
||||
- name: Push the image to the registry
|
||||
if: env.DISTANCE == '0'
|
||||
uses: actions/push-to-registry@v2
|
||||
with:
|
||||
registry: "docker://${{ vars.REGISTRY }}/${{ vars.ORGANISATION }}"
|
||||
image: tinyseady-mailer
|
||||
tags: latest ${{ steps.version.outputs.version }}
|
||||
image: tinysteady-mailer
|
||||
tags: "latest ${{ env.VERSION }}"
|
||||
|
||||
- name: Build wheel
|
||||
if: env.DISTANCE == '0'
|
||||
run: uv build --wheel
|
||||
|
||||
- name: Publish Python package (home)
|
||||
if: env.DISTANCE == '0'
|
||||
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
|
||||
continue-on-error: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue