-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: optimize & improve maintainability of GitHub Action definit…
…ion (#914) * fix(gha): correct use of `prerelease` option for GitHub Action * style(gha): improve shell format of GitHub Action script * docs(gha): update GitHub Actions doc with all available options * refactor(gha): drop cli defaults from action definition * refactor(gha): optimize gha docker definition * refactor(gha): drop defaults & optimize action entrypoint script * chore(dependabot): add updater for gha docker environment * refactor(gha): execute the gha version of semantic-release * refactor(gha): update container os to bookworm, dropping backports need When using Debian Bullseye, it did not have a git version available that supported SSH key signing. SSH key signing was integrated in git version 2.34 and the highest version for Bullseye was 2.30. Through the backports repository, a version greater than 2.34 was made available but now bumping to Debian Bookworm, the available version is 2.39 in the base OS repository so no backports configuration required. * build(deps): bump GitHub Action container to use `python3.12` Updates the base container that runs the GitHub Action environment to python3.12 which enables users to specify and run build scripts that are python3.12 specific as python3.12 is now the latest stable version of python available and we were only providing `3.10`. Resolves: #801 * refactor(gha): add common python binary module deps for builds * refactor(gha): removed execute permissions on action script
- Loading branch information
1 parent
6b24288
commit 85e27b7
Showing
5 changed files
with
97 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
# This Dockerfile is only for GitHub Actions | ||
FROM python:3.10-bullseye | ||
FROM python:3.12-bookworm | ||
|
||
RUN set -ex; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
git-lfs | ||
# Copy python-semantic-release source code into container | ||
COPY . /psr | ||
|
||
# install backported stable version of git, which supports ssh signing | ||
RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list; \ | ||
apt-get update;\ | ||
apt-get install -y git/bullseye-backports | ||
RUN \ | ||
# Install desired packages | ||
apt update && apt install -y --no-install-recommends \ | ||
# install git with git-lfs support | ||
git git-lfs \ | ||
# install python cmodule / binary module build utilities | ||
python3-dev gcc make cmake cargo \ | ||
# Configure global pip | ||
&& { \ | ||
printf '%s\n' "[global]"; \ | ||
printf '%s\n' "no-cache-dir = true"; \ | ||
printf '%s\n' "disable-pip-version-check = true"; \ | ||
} > /etc/pip.conf \ | ||
# Create virtual environment for python-semantic-release | ||
&& python3 -m venv /psr/.venv \ | ||
# Update core utilities in the virtual environment | ||
&& /psr/.venv/bin/pip install -U pip setuptools wheel \ | ||
# Install psr & its dependencies from source into virtual environment | ||
&& /psr/.venv/bin/pip install /psr \ | ||
# Cleanup | ||
&& apt clean -y | ||
|
||
ENV PYTHONPATH /semantic-release | ||
|
||
COPY . /semantic-release | ||
|
||
RUN cd /semantic-release && \ | ||
python -m venv /semantic-release/.venv && \ | ||
/semantic-release/.venv/bin/pip install . | ||
|
||
RUN /semantic-release/.venv/bin/python -m semantic_release --help | ||
|
||
ENTRYPOINT ["/semantic-release/action.sh"] | ||
ENTRYPOINT ["/bin/bash", "-l", "/psr/action.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters