Compare commits

...

11 Commits

Author SHA1 Message Date
msramalho
d14adf0242 Bump version to v0.2.24 for release 2023-02-08 11:22:53 +00:00
msramalho
75459d2880 docker 2023-02-08 11:22:38 +00:00
msramalho
94406bda7a Bump version to v0.2.23 for release 2023-02-08 10:42:12 +00:00
msramalho
6244f35cff Bump version to v0.2.22 for release 2023-02-08 09:50:36 +00:00
msramalho
adb3a7332f version 2023-02-08 09:49:48 +00:00
msramalho
0d903fa196 Bump version to v0.2.21 for release 2023-02-08 09:42:26 +00:00
msramalho
e5f3e56968 skip existing 2023-02-08 09:37:50 +00:00
msramalho
57e7023f64 Bump version to v0.2.20 for release 2023-02-08 09:27:53 +00:00
msramalho
be9e4b2032 Bump version to v0.2.19 for release 2023-02-08 00:02:55 +00:00
msramalho
59603d1136 Bump version to v0.2.18 for release 2023-02-07 23:59:45 +00:00
msramalho
db32b2db0d token name 2023-02-07 23:59:33 +00:00
10 changed files with 75 additions and 25 deletions

48
.github/workflows/docker-publish.yaml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
release:
types: [published]
push:
branches: [ "dockerize" ]
tags: [ "v*.*.*" ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: bellingcat/auto-archiver
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -11,12 +11,9 @@ name: Upload Python Package
on:
release:
types: [published]
push:
branches:
- dockerize
tags:
- 'v*.*.*'
branches: [ "dockerize" ]
tags: [ "v*.*.*" ]
permissions:
contents: read
@@ -46,11 +43,11 @@ jobs:
run: |
python -m pipenv run python setup.py sdist bdist_wheel
# to upload to test pypi, pass repository_url: https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
verbose: true
skip_existing: true
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: dist/

View File

@@ -21,7 +21,7 @@ RUN pip install --upgrade pip && \
# TODO: avoid copying unnecessary files, including .git
COPY Pipfile Pipfile.lock ./
RUN pipenv install --python=3.10 --system --deploy
ENV IS_DOCKER=1
# ENV IS_DOCKER=1
# doing this at the end helps during development, builds are quick
COPY ./src/ .

View File

@@ -3,7 +3,7 @@
set -e
TAG=$(python -c 'from src.auto_archiver.version import VERSION; print("v" + VERSION)')
TAG=$(python -c 'from src.auto_archiver.version import __version__; print("v" + __version__)')
read -p "Creating new release for $TAG. Do you want to continue? [Y/n] " prompt

View File

@@ -1,32 +1,36 @@
[metadata]
name = auto_archiver
version = 0.2.17
version = attr: auto_archiver.version.__version__
author = Bellingcat
author_email = tech@bellingcat.com
description = Easily archive online media content
long_description = file: README.md
long_description_content_type = text/markdown
keywords = archive, oosi, osint, scraping
license = MIT
classifiers =
Intended Audience :: Developers,
Intended Audience :: Science/Research,
License :: OSI Approved :: MIT License,
Programming Language :: Python :: 3,
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
project_urls =
Source Code = https://github.com/bellingcat/auto-archiver
Bug Tracker = https://github.com/bellingcat/auto-archiver/issues
Bellingcat = https://www.bellingcat.com
platforms = any
[options]
setup_requires =
setuptools-pipfile
zip_safe = False
include_package_data = True
package_dir=
=src
packages=find:
find_packages=true
python_requires = >=3.8
# [options.package_data]
# * = *.txt, *.rst
# hello = *.msg
[options.package_data]
* = *.html
[options.entry_points]
console_scripts =

View File

@@ -4,4 +4,4 @@ from . import archivers, databases, enrichers, feeders, formatters, storages, ut
from .core.orchestrator import ArchivingOrchestrator
from .core.config import Config
# making accessible directly
from .core.metadata import Metadata
from .core.metadata import Metadata

View File

@@ -4,6 +4,7 @@ import mimetypes, uuid, os, pathlib
from jinja2 import Environment, FileSystemLoader
from urllib.parse import quote
from ..version import __version__
from ..core import Metadata, Media
from . import Formatter
@@ -28,13 +29,13 @@ class HtmlFormatter(Formatter):
"detect_thumbnails": {"default": True, "help": "if true will group by thumbnails generated by thumbnail enricher by id 'thumbnail_00'"},
}
def format(self, item: Metadata) -> Media:
content = self.template.render(
url=item.get_url(),
title=item.get_title(),
media=item.media,
metadata=item.get_clean_metadata()
metadata=item.get_clean_metadata(),
version=__version__
)
html_path = os.path.join(item.get_tmp_dir(), f"formatted{str(uuid.uuid4())}.html")
with open(html_path, mode="w", encoding="utf-8") as outf:

View File

@@ -162,7 +162,7 @@
{% endfor %}
</table>
<p style="text-align:center;">Made with <a href="https://github.com/bellingcat/auto-archiver">bellingcat/auto-archiver</a></p>
<p style="text-align:center;">Made with <a href="https://github.com/bellingcat/auto-archiver">bellingcat/auto-archiver</a> v{{ version }}</p>
</body>
<script defer>
// notification logic

View File

@@ -3,10 +3,10 @@ _MAJOR = "0"
_MINOR = "2"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "17"
_PATCH = "24"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""
VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR)
VERSION = "{0}.{1}.{2}{3}".format(_MAJOR, _MINOR, _PATCH, _SUFFIX)
__version__ = "{0}.{1}.{2}{3}".format(_MAJOR, _MINOR, _PATCH, _SUFFIX)