diff --git a/.codacy.yml b/.codacy.yml index 9625f8d..3161697 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -1,8 +1,6 @@ --- exclude_paths: - .github/** - - changelog/** - - CHANGELOG.md ... diff --git a/.github/settings.yml b/.github/settings.yml index b1bb6e3..591d0fb 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -34,6 +34,7 @@ branches: restrictions: apps: - renovate + - gopad users: [] teams: - admins diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..2c9e5e6 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,49 @@ +--- +name: automerge + +"on": + workflow_dispatch: + pull_request: + branches: + - master + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + + steps: + - name: Generate token + id: token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.TOKEN_EXCHANGE_APP }} + installation_retrieval_mode: id + installation_retrieval_payload: ${{ secrets.TOKEN_EXCHANGE_INSTALL }} + private_key: ${{ secrets.TOKEN_EXCHANGE_KEY }} + permissions: >- + {"contents": "write", "pull_requests": "write", "issues": "write"} + + - name: Fetch metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Approve request + id: approve + run: gh pr review --approve "${{github.event.pull_request.html_url}}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable automerge + id: automerge + run: gh pr merge --rebase --auto "${{github.event.pull_request.html_url}}" + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + +... diff --git a/.github/workflows/changes.yml b/.github/workflows/changes.yml deleted file mode 100644 index 4f998d1..0000000 --- a/.github/workflows/changes.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: changes - -"on": - push: - branches: - - master - -jobs: - changelog: - runs-on: ubuntu-latest - - steps: - - name: Checkout source - id: source - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - with: - token: ${{ secrets.BOT_ACCESS_TOKEN }} - - - name: Build changelog - uses: actionhippie/calens@v1 - with: - target: CHANGELOG.md - - - name: Commit changes - id: commit - uses: EndBug/add-and-commit@v9 - with: - author_name: GitHub Actions - author_email: github@gopad.eu - add: CHANGELOG.md - message: "docs: automated changelog update" - push: true - commit: --signoff - -... diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml new file mode 100644 index 0000000..45a7bf7 --- /dev/null +++ b/.github/workflows/flake.yml @@ -0,0 +1,56 @@ +--- +name: flake + +"on": + workflow_dispatch: + schedule: + - cron: "0 8 * * 1" + +permissions: + contents: write + pull-requests: write + +jobs: + flake: + runs-on: ubuntu-latest + + steps: + - name: Generate token + id: token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.TOKEN_EXCHANGE_APP }} + installation_retrieval_mode: id + installation_retrieval_payload: ${{ secrets.TOKEN_EXCHANGE_INSTALL }} + private_key: ${{ secrets.TOKEN_EXCHANGE_KEY }} + permissions: >- + {"contents": "write", "pull_requests": "write"} + + - name: Checkout source + id: source + uses: actions/checkout@v4 + + - name: Install nix + id: nix + uses: cachix/install-nix-action@v27 + + - name: Update flake + id: flake + uses: DeterminateSystems/update-flake-lock@v21 + with: + commit-msg: "chore(flake): updated lockfile" + pr-title: "chore: automated flake update" + pr-body: "New flakelock generated, automerge should handle that!" + pr-labels: renovate + git-author-name: GitHub Actions + git-author-email: github@webhippie.de + token: ${{ steps.token.outputs.token }} + + - name: Enable automerge + id: automerge + if: steps.flake.outputs.pull-request-operation == 'created' + run: gh pr merge --rebase --auto "${{ steps.flake.outputs.pull-request-number }}" + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + +... diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml index 89985ae..d90dc8e 100644 --- a/.github/workflows/general.yml +++ b/.github/workflows/general.yml @@ -16,6 +16,6 @@ jobs: steps: - name: Checkout source id: source - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@v4 ... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..69d93e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.direnv +.devenv diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 2b61a6a..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -# Changelog for unreleased - -The following sections list the changes for unreleased. - -## Summary - - * Chg #1: Initial release of basic version - -## Details - - * Change #1: Initial release of basic version - - Just prepared an initial basic version which could be released as a pre-alpha - version to ship a minimal viable product. - - https://github.com/gopad/gopad-android/issues/1 - - diff --git a/README.md b/README.md index 676b1a7..27b9076 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gopad: Android -[![General Workflow](https://github.com/gopad/gopad-android/actions/workflows/general.yml/badge.svg)](https://github.com/gopad/gopad-android/actions/workflows/general.yml) [![Join the Matrix chat at https://matrix.to/#/#gopad:matrix.org](https://img.shields.io/badge/matrix-%23gopad%3Amatrix.org-7bc9a4.svg)](https://matrix.to/#/#gopad:matrix.org) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/71b7d07cce174ff5bd4265a1012807b9)](https://www.codacy.com/gh/gopad/gopad-android/dashboard?utm_source=github.com&utm_medium=referral&utm_content=gopad/gopad-android&utm_campaign=Badge_Grade) +[![General Workflow](https://github.com/gopad/gopad-android/actions/workflows/general.yml/badge.svg)](https://github.com/gopad/gopad-android/actions/workflows/general.yml) [![Join the Matrix chat at https://matrix.to/#/#gopad:matrix.org](https://img.shields.io/badge/matrix-%23gopad%3Amatrix.org-7bc9a4.svg)](https://matrix.to/#/#gopad:matrix.org) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/71b7d07cce174ff5bd4265a1012807b9)](https://app.codacy.com/gh/gopad/gopad-android/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) TBD diff --git a/changelog/CHANGELOG.tmpl b/changelog/CHANGELOG.tmpl deleted file mode 100644 index e9e3b5c..0000000 --- a/changelog/CHANGELOG.tmpl +++ /dev/null @@ -1,28 +0,0 @@ -{{- range $changes := . }}{{ with $changes -}} -# Changelog for {{ .Version }} - -The following sections list the changes for {{ .Version }}. - -## Summary -{{ range $entry := .Entries }}{{ with $entry }} - * {{ .TypeShort }} #{{ .PrimaryID }}: {{ .Title }} -{{- end }}{{ end }} - -## Details -{{ range $entry := .Entries }}{{ with $entry }} - * {{ .Type }} #{{ .PrimaryID }}: {{ .Title }} -{{ range $par := .Paragraphs }} - {{ wrapIndent $par 80 3 }} -{{ end -}} -{{ range $url := .IssueURLs }} - {{ $url -}} -{{ end -}} -{{ range $url := .PRURLs }} - {{ $url -}} -{{ end -}} -{{ range $url := .OtherURLs }} - {{ $url -}} -{{ end }} -{{ end }}{{ end }} - -{{ end }}{{ end -}} diff --git a/changelog/README.md b/changelog/README.md deleted file mode 100644 index 0ae5d5b..0000000 --- a/changelog/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Changelog - -We are using [calens](https://github.com/restic/calens) to properly generate a -changelog before we are tagging a new release. To get an idea how this could -look like would be the -best reference. diff --git a/changelog/TEMPLATE b/changelog/TEMPLATE deleted file mode 100644 index 4e3718f..0000000 --- a/changelog/TEMPLATE +++ /dev/null @@ -1,11 +0,0 @@ -Bugfix: Fix behavior for foobar (in present tense) - -We've fixed the behavior for foobar, a long-standing annoyance for users. The -text should be wrapped at 80 characters length. - -The text in the paragraphs is written in past tense. The last section is a list -of issue URLs, PR URLs and other URLs. The first issue ID (or the first PR ID, -in case there aren't any issue links) is used as the primary ID. - -https://github.com/gopad/gopad-android/issues/1234 -https://github.com/gopad/gopad-android/pull/55555 diff --git a/changelog/unreleased/.keep b/changelog/unreleased/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/changelog/unreleased/initial-release.md b/changelog/unreleased/initial-release.md deleted file mode 100644 index 963b53b..0000000 --- a/changelog/unreleased/initial-release.md +++ /dev/null @@ -1,6 +0,0 @@ -Change: Initial release of basic version - -Just prepared an initial basic version which could be released as a pre-alpha -version to ship a minimal viable product. - -https://github.com/gopad/gopad-android/issues/1 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ab554df --- /dev/null +++ b/flake.lock @@ -0,0 +1,472 @@ +{ + "nodes": { + "cachix": { + "inputs": { + "devenv": "devenv_2", + "flake-compat": [ + "devenv", + "flake-compat" + ], + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "pre-commit-hooks": [ + "devenv", + "pre-commit-hooks" + ] + }, + "locked": { + "lastModified": 1712055811, + "narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=", + "owner": "cachix", + "repo": "cachix", + "rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "cachix", + "type": "github" + } + }, + "devenv": { + "inputs": { + "cachix": "cachix", + "flake-compat": "flake-compat_2", + "nix": "nix_2", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1716847473, + "narHash": "sha256-Sn3PpgNAmV9pLr8pefvVAiHzBebq23nFf5QeHqMfVGk=", + "owner": "cachix", + "repo": "devenv", + "rev": "60ed3dba92ed027bb886611b53cf9b9d1e7f149e", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "devenv_2": { + "inputs": { + "flake-compat": [ + "devenv", + "cachix", + "flake-compat" + ], + "nix": "nix", + "nixpkgs": "nixpkgs", + "poetry2nix": "poetry2nix", + "pre-commit-hooks": [ + "devenv", + "cachix", + "pre-commit-hooks" + ] + }, + "locked": { + "lastModified": 1708704632, + "narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=", + "owner": "cachix", + "repo": "devenv", + "rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "python-rewrite", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "devenv", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nix": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "devenv", + "cachix", + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1712911606, + "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", + "owner": "domenkozar", + "repo": "nix", + "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "devenv-2.21", + "repo": "nix", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "devenv", + "cachix", + "devenv", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1688870561, + "narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "165b1650b753316aa7f1787f3005a8d2da0f5301", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix_2": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression_2" + }, + "locked": { + "lastModified": 1712911606, + "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", + "owner": "domenkozar", + "repo": "nix", + "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "devenv-2.21", + "repo": "nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1692808169, + "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9201b5ff357e781bf014d0330d18555695df7ba8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-regression_2": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1713361204, + "narHash": "sha256-TA6EDunWTkc5FvDCqU3W2T3SFn0gRZqh6D/hJnM02MM=", + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1716509168, + "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bfb7a882678e518398ce9a31a881538679f6f092", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "devenv", + "cachix", + "devenv", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692876271, + "narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1713775815, + "narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_3" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c5dfaa2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + description = "Nix flake for development"; + + inputs = { + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + devenv = { + url = "github:cachix/devenv"; + }; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + }; + }; + + outputs = inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + inputs.devenv.flakeModule + ]; + + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + perSystem = { config, self', inputs', pkgs, system, ... }: { + imports = [ + { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + } + ]; + + devenv = { + shells = { + default = { + + }; + }; + }; + }; + }; +}