diff --git a/.forgejo/workflows/renovate.yml b/.forgejo/workflows/renovate.yml new file mode 100644 index 0000000..0ebc40a --- /dev/null +++ b/.forgejo/workflows/renovate.yml @@ -0,0 +1,33 @@ +name: Renovate + +on: + schedule: + - cron: '0 6 * * *' + workflow_dispatch: + +jobs: + renovate: + name: Renovate + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v4 + + - name: Setup Dagger Remote Engine (via stunnel) + env: + DAGGER_STUNNEL_URL: ${{ secrets.DAGGER_STUNNEL_URL }} + DAGGER_CA_CERT: ${{ secrets.DAGGER_CA_CERT }} + DAGGER_CLIENT_CERT: ${{ secrets.DAGGER_CLIENT_CERT }} + DAGGER_CLIENT_KEY: ${{ secrets.DAGGER_CLIENT_KEY }} + run: scripts/setup_dagger_remote.sh + + - name: Run Renovate + env: + DAGGER_NO_NAG: "1" + RENOVATE_FORGEJO_TOKEN: ${{ secrets.RENOVATE_FORGEJO_TOKEN }} + run: task renovate + + - name: Cleanup TLS credentials + if: always() + run: rm -rf /tmp/dagger-tls /tmp/stunnel-dagger.conf /tmp/stunnel.pid diff --git a/Taskfile.yml b/Taskfile.yml index da72518..481dfd3 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -336,6 +336,14 @@ tasks: - | dagger query '{ engine { localCache { prune(maxUsedSpace: "75gb", targetSpace: "50gb") } } }' + renovate: + desc: Run Renovate bot against the repository via Dagger + preconditions: + - sh: test -n "$RENOVATE_FORGEJO_TOKEN" + msg: "RENOVATE_FORGEJO_TOKEN is not set" + cmds: + - dagger call --progress=plain -q -m ci --source=. renovate --renovate-token env:RENOVATE_FORGEJO_TOKEN + integration-android: desc: UI integration tests on a connected Android emulator (Stalwart on host, emulator reaches it via 10.0.2.2) deps: [_preflight, _android-sdk-check, _android-avd-setup] diff --git a/ci/main.go b/ci/main.go index 44cd536..294b069 100644 --- a/ci/main.go +++ b/ci/main.go @@ -842,6 +842,18 @@ func (m *Ci) PublishAndroid( return m.UploadToPlayStore(ctx, signed, playStoreConfig) } +// Renovate runs Renovate bot against the repository on Forgejo/Codeberg. +func (m *Ci) Renovate(ctx context.Context, renovateToken *dagger.Secret) (string, error) { + return dag.Container(). + From("renovate/renovate:39"). + WithSecretVariable("RENOVATE_TOKEN", renovateToken). + WithEnvVariable("RENOVATE_PLATFORM", "forgejo"). + WithEnvVariable("RENOVATE_ENDPOINT", "https://codeberg.org"). + WithEnvVariable("RENOVATE_REPOSITORIES", "guettli/sharedinbox"). + WithExec([]string{"renovate"}). + Stdout(ctx) +} + // Graph returns a Mermaid diagram of the CI pipeline structure. // Paste the output into any Mermaid renderer (codeberg, github, mermaid.live) // or save it as a .md file to get a rendered diagram. diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..52914a2 --- /dev/null +++ b/renovate.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ], + "labels": ["dependencies"], + "github-actions": { + "fileMatch": ["^\\.forgejo/workflows/[^/]+\\.ya?ml$"] + } +}