Skip to content

Commit

Permalink
fix: updating build scripts, readme, python dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
plockaby committed Dec 22, 2024
1 parent 60e37e8 commit b6243dd
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 66 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/release-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
permissions:
contents: read
packages: write
id-token: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -51,10 +50,8 @@ jobs:
# this is an example of building a single arch image on a specific arch.
# this will work well with AWS Lambda.
#
# - name: Configure docker for multiarch builds
# - name: Configure Docker for multi-arch builds#
# uses: docker/setup-qemu-action@v3
# with:
# platforms: "arm64"
#
# - name: Build and push container image
# run: |
Expand All @@ -74,23 +71,33 @@ jobs:
# - name: Set up QEMU for docker multiarch builds
# uses: docker/setup-qemu-action@v3
#
# - name: Set up docker buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Build and push container images
# run: |
# docker buildx build --push --platform $IMAGE_ARCH -t $IMAGE_NAME:${{ github.ref_name }} -t $IMAGE_NAME:latest .
# env:
# IMAGE_ARCH: linux/amd64,linux/arm64
# IMAGE_NAME: ghcr.io/myaccount/myrepo

- name: Configure Docker for multi-arch builds
uses: docker/setup-qemu-action@v3

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build, tag, and push docker image to the GitHub Container Registry
run: make push

- name: Install poetry
run: pipx install poetry

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.12.x"
python-version: "3.13.x"
cache: "poetry"

- name: Run python build
Expand All @@ -101,7 +108,9 @@ jobs:
- name: Update release
uses: softprops/[email protected]
with:
files: "dist/*"
files: |
dist/*
CHANGELOG.md
tag_name: "${{ github.ref_name }}"

- run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:

- id: cz
name: Create changelog and bump version
uses: commitizen-tools/[email protected].0
uses: commitizen-tools/[email protected].1
with:
changelog: true
changelog_increment_filename: "changes.md"
changelog_increment_filename: "CHANGELOG.md"
git_redirect_stderr: true
increment: ${{ inputs.increment }}
prerelease: ${{ inputs.prerelease }}
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Create release
uses: softprops/[email protected]
with:
body_path: "changes.md"
body_path: "CHANGELOG.md"
tag_name: "v${{ steps.cz.outputs.version }}"

- run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.13.1-slim-bookworm@sha256:f41a75c9cee9391c09e0139f7b49d4b1fbb119944ec740ecce4040626dc07bed AS base

# github metadata
LABEL org.opencontainers.image.source=https://github.com/paullockaby/test-repo
LABEL org.opencontainers.image.source=https://github.com/paullockaby/test-python

# install updates and dependencies
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif

# get image id based on tag or commit
IMAGE_VERSION := $(or $(IMAGE_TAG),$(IMAGE_COMMIT))
IMAGE_NAME := "ghcr.io/paullockaby/test-repo"
IMAGE_NAME := "ghcr.io/paullockaby/test-python"
IMAGE_ID := "${IMAGE_NAME}:${IMAGE_VERSION}"

all: build
Expand All @@ -38,7 +38,7 @@ buildx:

.PHONY: push
push:
@echo "pushing $(IMAGE_ID)"
@echo "pushing $(IMAGE_ID) with buildx"
docker buildx build --push --platform linux/amd64,linux/arm64 -t $(IMAGE_ID) -t $(IMAGE_NAME):latest .

.PHONY: clean
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# test-repo
# test-python

This is a testing ground for building a Python project with all of the bells and whistles of a build pipeline using GitHub Actions.

![GitHub License](https://img.shields.io/github/license/paullockaby/test-repo)
![GitHub Release](https://img.shields.io/github/v/release/paullockaby/test-repo)
![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fpaullockaby%2Ftest-repo%2Fmain%2Fpyproject.toml)
[![Merge Pipelines](https://github.com/paullockaby/test-repo/actions/workflows/merge.yaml/badge.svg)](https://github.com/paullockaby/test-repo/actions/workflows/merge.yaml)
![GitHub License](https://img.shields.io/github/license/paullockaby/test-python)
![GitHub Release](https://img.shields.io/github/v/release/paullockaby/test-python)
![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fpaullockaby%2Ftest-python%2Fmain%2Fpyproject.toml)

[![Mastodon Follow](https://img.shields.io/mastodon/follow/106882571030731815?domain=https%3A%2F%2Funcontrollablegas.com)](https://uncontrollablegas.com/@paul)

Expand Down
92 changes: 46 additions & 46 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6243dd

Please sign in to comment.