From b75e2e9971e1e597ee9d31a21ef23fe89d8a053f Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 6 Dec 2024 01:47:03 +0100 Subject: [PATCH] CI: build container --- .forgejo/workflows/build.yaml | 36 ++++++++++++++++++++++++++++++++++- pyproject.toml | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 7409e2f..ac10775 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -30,7 +30,41 @@ jobs: - name: Build wheel run: uv build --wheel - - name: Publish to home + - 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/sms-handler --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: sms-handler + oci: true + labels: sms-handler + tags: ${{ 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: ssm-handler + tags: ${{ steps.version.outputs.version }} diff --git a/pyproject.toml b/pyproject.toml index 69149da..3478423 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sms_handler" -version = "0.0.9" +version = "0.0.10" #dynamic = ["version"] description = "Listen to messages from the SMS Forwarder app on Android and send mail" readme = "README.md"