Skip to content

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Oct 23, 2024
2 parents 0924047 + bc96205 commit 5e55aba
Show file tree
Hide file tree
Showing 12 changed files with 624 additions and 486 deletions.
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-docstring-first
- id: check-json
Expand Down Expand Up @@ -36,9 +36,13 @@ repos:
exclude: "(^Pipfile\\.lock$)"
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.5.5'
rev: 'v0.7.0'
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.4.3"
hooks:
- id: pyproject-fmt
14 changes: 0 additions & 14 deletions .ruff.toml

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.0] - 2024-10-23

### Added

- Transition to `uv` for dependency and virtual environment management

### Changed

- Bump mypy from 1.11.0 to 1.11.1 (by @dependabot in [#102](https://github.com/stumpylog/image-cleaner-action/pull/102))
- Bump ruff from 0.5.5 to 0.6.1 (by @dependabot in [#105](https://github.com/stumpylog/image-cleaner-action/pull/105))
- Bump mypy from 1.11.1 to 1.13.0 (by @dependabot in [#120](https://github.com/stumpylog/image-cleaner-action/pull/120))
- Bump ruff from 0.6.1 to 0.7.0 (by @dependabot in [#118](https://github.com/stumpylog/image-cleaner-action/pull/118))
- Bump httpx from 0.27.0 to 0.27.2 (by @dependabot in [#109](https://github.com/stumpylog/image-cleaner-action/pull/109))

## [0.8.0] - 2024-07-30

### Fixed
Expand Down
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

398 changes: 0 additions & 398 deletions Pipfile.lock

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

This repository contains two actions for solving problems with the GitHub Container Registry.

These

## Ephemeral Image Removal

Many actions in a repository will end up creating a Docker image stored on the GitHub Container Registry
Expand Down
47 changes: 19 additions & 28 deletions ephemeral/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,29 @@ runs:
with:
python-version: '3.11'
-
name: Install pipenv
shell: bash
run: |
pip3 --quiet install --user pipenv==2023.12.1
-
name: Install dependencies
shell: bash
run: |
cd ${{ github.action_path }}/..
pipenv --quiet --python ${{ steps.setup-python.outputs.python-version }} sync
-
name: List installed dependencies
shell: bash
run: |
cd ${{ github.action_path }}/..
pipenv --quiet --python ${{ steps.setup-python.outputs.python-version }} run pip list
name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.x"
-
name: Clean the images
shell: bash
id: ephemeral-image-clean
run: |
cd ${{ github.action_path }}/..
pipenv --quiet \
uv run \
--frozen \
--quiet \
--no-python-downloads \
--no-dev \
--python ${{ steps.setup-python.outputs.python-version }} \
run \
${{ github.action_path }}/../main_ephemeral.py \
--token "${{ inputs.token }}" \
--owner "${{ inputs.owner }}" \
--scheme "${{ inputs.scheme }}" \
--match-regex "${{ inputs.match_regex }}" \
--is-org "${{ inputs.is_org }}" \
--name "${{ inputs.package_name }}" \
--delete "${{ inputs.do_delete }}" \
--loglevel "${{ inputs.log_level }}" \
--repo "${{ inputs.repo_name }}"
${{ github.action_path }}/../main_ephemeral.py \
--token "${{ inputs.token }}" \
--owner "${{ inputs.owner }}" \
--scheme "${{ inputs.scheme }}" \
--match-regex "${{ inputs.match_regex }}" \
--is-org "${{ inputs.is_org }}" \
--name "${{ inputs.package_name }}" \
--delete "${{ inputs.do_delete }}" \
--loglevel "${{ inputs.log_level }}" \
--repo "${{ inputs.repo_name }}"
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[project]
name = "image-cleaner-action"
version = "0.9.0"
description = "Tools to cleanup old ghcr.io images when the source is removed"
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"github-action-utils>=1.1",
"httpx[brotli,http2]>=0.27",
]

[tool.ruff]
target-version = "py311"
line-length = 110
respect-gitignore = true
# https://docs.astral.sh/ruff/settings/
fix = true
show-fixes = true

output-format = "grouped"
# https://docs.astral.sh/ruff/rules/
lint.extend-select = [
"COM",
"E",
"EXE",
"F",
"G201",
"I",
"ICN",
"INP",
"ISC",
"PIE",
"PLC",
"PLE",
"PTH",
"RSE",
"RUF",
"SIM",
"TID",
"UP",
"W",
]
# https://docs.astral.sh/ruff/settings/#lintisort
lint.isort.force-single-line = true

[tool.uv]
dev-dependencies = [ "ruff", "pre-commit", "pre-commit-uv", "mypy" ]
2 changes: 2 additions & 0 deletions src/image_cleaner_action/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello() -> str:
return "Hello from image-cleaner-action!"
41 changes: 16 additions & 25 deletions untagged/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,26 @@ runs:
with:
python-version: '3.11'
-
name: Install pipenv
shell: bash
run: |
pip3 --quiet install --user pipenv==2023.12.1
-
name: Install dependencies
shell: bash
run: |
cd ${{ github.action_path }}/..
pipenv --quiet --python ${{ steps.setup-python.outputs.python-version }} sync
-
name: List installed dependencies
shell: bash
run: |
cd ${{ github.action_path }}/..
pipenv --quiet --python ${{ steps.setup-python.outputs.python-version }} run pip list
name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.x"
-
name: Clean the images
shell: bash
id: untagged-image-clean
run: |
cd ${{ github.action_path }}/..
pipenv --quiet \
uv run \
--frozen \
--quiet \
--no-python-downloads \
--no-dev \
--python ${{ steps.setup-python.outputs.python-version }} \
run \
${{ github.action_path }}/../main_untagged.py \
--token "${{ inputs.token }}" \
--owner "${{ inputs.owner }}" \
--is-org "${{ inputs.is_org }}" \
--name "${{ inputs.package_name }}" \
--delete "${{ inputs.do_delete }}" \
--loglevel "${{ inputs.log_level }}"
${{ github.action_path }}/../main_untagged.py \
--token "${{ inputs.token }}" \
--owner "${{ inputs.owner }}" \
--is-org "${{ inputs.is_org }}" \
--name "${{ inputs.package_name }}" \
--delete "${{ inputs.do_delete }}" \
--loglevel "${{ inputs.log_level }}"
Loading

0 comments on commit 5e55aba

Please sign in to comment.