From 1a03f9f12ef499cf3477100392bd0d35fd08a8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Sat, 24 Oct 2026 12:44:23 +0200 Subject: [PATCH] CI: date versions from VERSION Add a VERSION file, make version/release, an extra : tag on latest and a release job. --- .github/workflows/docker.yml | 24 +++++++++++++++++++++++- Makefile | 12 ++++++++++++ README.md | 5 +++++ VERSION | 1 + 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 VERSION diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a0be410..e1490ef 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -32,6 +32,10 @@ jobs: - name: Checkout uses: actions/checkout@v7 + - name: Read VERSION + id: version + run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" + - name: Login to DockerHub uses: docker/login-action@v4 with: @@ -49,9 +53,27 @@ jobs: with: context: ${{ matrix.context }} push: true - tags: dockette/rendertron:${{ matrix.tag }} + tags: | + dockette/rendertron:${{ matrix.tag }} + ${{ matrix.tag == 'latest' && format('dockette/rendertron:{0}', steps.version.outputs.version) || '' }} platforms: linux/amd64 # linux/arm64 + release: + name: "Release" + needs: docker + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + run: gh release view "$(cat VERSION)" || gh release create "$(cat VERSION)" --generate-notes + docs: name: "Docs" needs: docker diff --git a/Makefile b/Makefile index 105bb8e..20cfca3 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +VERSION:=$(shell cat VERSION) + build-rendertron: docker build -t dockette/rendertron ./rendertron @@ -32,3 +34,13 @@ run-tracer: -e TRACER_SRC_SITEMAP_1=https://example.com/sitemaps/pages.xml \ -e TRACER_SRC_SITEMAP_2=https://example.com/sitemaps/pages2.xml \ dockette/rendertron:tracer + +.PHONY: version +version: + @echo ${VERSION} + +.PHONY: release +release: + @date -u +%Y.%m.%d > VERSION + @echo "VERSION: ${VERSION} -> $$(cat VERSION)" + @echo "next: git commit -am \"Release: $$(cat VERSION)\" && git push" diff --git a/README.md b/README.md index df671b4..1b99e4b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,11 @@ docker run -it --rm -p 3000:3000 dockette/rendertron ![Screenshot](.docs/screenshot.png) +## Versions + +The release version is the date in [`VERSION`](VERSION). CI pushes `latest` also as `dockette/rendertron:`. +To release, run `make release`, commit and push to `master`. + ## Maintenance See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to [support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..7387f12 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2026.10.23