Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
10 changes: 10 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": {
".": {
"release-type": "ruby",
"package-name": "html2rss-web",
"version-file": "config/version.rb",
"changelog-path": "CHANGELOG.md"
}
}
}
93 changes: 0 additions & 93 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,96 +172,3 @@ jobs:
DOCKER_SMOKE_SKIP_BUILD: "true"
SMOKE_AUTO_SOURCE_ENABLED: ${{ matrix.smoke_auto_source_enabled }}
run: bundle exec rake

docker-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- docker-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE_NAME: html2rss/web
TAG_SHA: ${{ github.sha }}
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
cache: true
cache_dependency_path: frontend/pnpm-lock.yaml
package_json_file: frontend/package.json

- name: Setup Node.js for Docker build
uses: actions/setup-node@v6
with:
node-version-file: ".tool-versions"

- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
working-directory: frontend

- name: Build frontend static assets
run: pnpm run build
working-directory: frontend

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Get Git commit timestamps
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV

- name: Extract metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.IMAGE_NAME }}

- name: Log in to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Cache Docker layers
uses: actions/cache@v5
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build and push Docker image
uses: docker/build-push-action@v7
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
with:
context: .
push: true
tags: |
html2rss/web:latest
html2rss/web:${{ github.sha }}
${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
provenance: true
sbom: true
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=html2rss-web
org.opencontainers.image.description=Generates RSS feeds of any website & serves to the web!
org.opencontainers.image.sbom=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts

- name: Move updated cache into place
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
167 changes: 167 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

Comment thread
gildesmarais marked this conversation as resolved.
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json

- name: Summarize release outcome
env:
RELEASE_CREATED: ${{ steps.release.outputs.release_created }}
RELEASE_TAG: ${{ steps.release.outputs.tag_name }}
run: |
{
echo "## Release outcome"
echo
echo "- Release created: ${RELEASE_CREATED:-false}"
if [ -n "${RELEASE_TAG}" ]; then
echo "- Release tag: ${RELEASE_TAG}"
else
echo "- Release tag: none"
fi
} >> "$GITHUB_STEP_SUMMARY"

docker-publish:
if: needs.release.outputs.release_created == 'true'
needs:
- release
runs-on: ubuntu-latest
env:
IMAGE_NAME: html2rss/web
TAG_SHA: ${{ github.sha }}
RELEASE_TAG: ${{ needs.release.outputs.tag_name }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
cache: true
cache_dependency_path: frontend/pnpm-lock.yaml
package_json_file: frontend/package.json

- name: Setup Node.js for Docker build
uses: actions/setup-node@v6
with:
node-version-file: ".tool-versions"

- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
working-directory: frontend

- name: Build frontend static assets
run: pnpm run build
working-directory: frontend

Comment thread
gildesmarais marked this conversation as resolved.
Outdated
- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Get Git commit timestamp
run: |
echo "TIMESTAMP_EPOCH=$(git log -1 --format=%ct)" >> "$GITHUB_ENV"
echo "TIMESTAMP_ISO=$(git log -1 --format=%cI)" >> "$GITHUB_ENV"

- name: Compute Docker tags
id: tags
run: |
release_version="${RELEASE_TAG#v}"
echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV"
major="${release_version%%.*}"
{
echo "tags<<EOF"
echo "${IMAGE_NAME}:${release_version}"
echo "${IMAGE_NAME}:${major}"
echo "${IMAGE_NAME}:latest"
echo "${IMAGE_NAME}:${TAG_SHA}"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Log in to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Build and push Docker image
uses: docker/build-push-action@v7
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP_EPOCH }}
with:
context: .
push: true
tags: ${{ steps.tags.outputs.tags }}
build-args: |
BUILD_TAG=${{ env.RELEASE_VERSION }}
GIT_SHA=${{ github.sha }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
provenance: true
sbom: true
labels: |
org.opencontainers.image.created=${{ env.TIMESTAMP_ISO }}
org.opencontainers.image.description=Generates RSS feeds of any website & serves to the web!
org.opencontainers.image.ref.name=${{ env.RELEASE_TAG }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.title=html2rss-web
org.opencontainers.image.url=https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_TAG }}
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}

- name: Move updated cache into place
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

- name: Summarize published image tags
run: |
{
echo "## Docker publish"
echo
echo "- Release tag: ${RELEASE_TAG}"
echo "- Docker tags pushed:"
echo "${{ steps.tags.outputs.tags }}" | sed 's/^/ - /'
} >> "$GITHUB_STEP_SUMMARY"
107 changes: 107 additions & 0 deletions .github/workflows/release_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: refresh release artifacts

on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main
push:
branches:
- release-please--branches--main

Comment thread
gildesmarais marked this conversation as resolved.
permissions:
contents: read

Comment thread
gildesmarais marked this conversation as resolved.
concurrency:
group: release-artifacts-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
verify-generated-artifacts:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.event.pull_request.head.ref, 'release-please--branches--')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
cache: true
cache_dependency_path: frontend/pnpm-lock.yaml
package_json_file: frontend/package.json

- uses: actions/setup-node@v6
with:
node-version-file: ".tool-versions"

- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
working-directory: frontend

- name: Refresh OpenAPI artifacts
run: |
make openapi
make openapi-client

- name: Assert generated artifacts are current
run: git diff --exit-code -- public/openapi.yaml frontend/src/api/generated

refresh-generated-artifacts:
if: github.event_name == 'push' && github.repository == 'html2rss/html2rss-web' && github.ref == 'refs/heads/release-please--branches--main'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.ref_name }}
fetch-depth: 0

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
cache: true
cache_dependency_path: frontend/pnpm-lock.yaml
package_json_file: frontend/package.json

- uses: actions/setup-node@v6
with:
node-version-file: ".tool-versions"

- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
working-directory: frontend

- name: Refresh OpenAPI artifacts
run: |
make openapi
make openapi-client

- name: Commit generated artifacts
run: |
if git diff --quiet -- public/openapi.yaml frontend/src/api/generated; then
echo "Generated artifacts already up to date"
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add public/openapi.yaml frontend/src/api/generated
git commit -m "chore: refresh release artifacts"
git push
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

All notable changes to this project will be documented in this file.
Loading
Loading