diff --git a/.github/renovate.json b/.github/renovate.json5 similarity index 75% rename from .github/renovate.json rename to .github/renovate.json5 index 69fb4cdad..8978459cf 100644 --- a/.github/renovate.json +++ b/.github/renovate.json5 @@ -6,7 +6,8 @@ "packageRules": [ { "matchPackagePatterns": [ - "^@homarr/" + "^@homarr/", + "tsx" // Disabled for now as version 0.14.4 did not work with the current version of homarr. It resulted in a ERR_MODULE_NOT_FOUND error ], "enabled": false }, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b8fbfaa9d..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build apps and migration script - -on: - pull_request: - branches: ["*"] - push: - branches: ["main"] - merge_group: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} - -env: - FORCE_COLOR: 3 - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup - uses: ./tooling/github/setup - - - name: Copy env - shell: bash - run: cp .env.example .env - - - name: Build - run: pnpm build diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 228dd9989..a75c144b7 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -1,4 +1,4 @@ -name: Code quality analysis +name: "[Quality] Code Analysis" on: pull_request: @@ -8,7 +8,7 @@ on: merge_group: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} # You can leverage Vercel Remote Caching with Turbo to speed up your builds @@ -72,3 +72,15 @@ jobs: # Only works if you set `reportOnFailure: true` in your vite config as specified above if: always() uses: davelosert/vitest-coverage-report-action@v2 + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup + uses: ./tooling/github/setup + - name: Copy env + shell: bash + run: cp .env.example .env + - name: Build + run: pnpm build diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventions-semantic-commits.yml similarity index 77% rename from .github/workflows/conventional-commits.yml rename to .github/workflows/conventions-semantic-commits.yml index 8f2216bd7..d26307ba0 100644 --- a/.github/workflows/conventional-commits.yml +++ b/.github/workflows/conventions-semantic-commits.yml @@ -1,7 +1,5 @@ - # https://github.com/webiny/action-conventional-commits?tab=readme-ov-file - -name: Conventional Commits +name: "[Conventions] Semantic Commits" on: pull_request: @@ -12,5 +10,5 @@ jobs: name: Conventional Commits runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: webiny/action-conventional-commits@v1.3.0 \ No newline at end of file diff --git a/.github/workflows/pr-conventional-commits.yml b/.github/workflows/conventions-semantic-pull-requests.yml similarity index 81% rename from .github/workflows/pr-conventional-commits.yml rename to .github/workflows/conventions-semantic-pull-requests.yml index e3dfb587b..cec459930 100644 --- a/.github/workflows/pr-conventional-commits.yml +++ b/.github/workflows/conventions-semantic-pull-requests.yml @@ -1,4 +1,4 @@ -name: "Lint PR" +name: "[Conventions] Semantic PRs" on: pull_request_target: @@ -11,8 +11,7 @@ permissions: pull-requests: read jobs: - main: - name: Validate PR title + validate-pull-request-title: runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/deployment-docker-image.yml similarity index 95% rename from .github/workflows/docker-image.yml rename to .github/workflows/deployment-docker-image.yml index 046523358..40279c171 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/deployment-docker-image.yml @@ -1,4 +1,4 @@ -name: Docker image +name: "[Deployment] Release" on: pull_request: @@ -70,13 +70,13 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" tags: | type=raw,value=latest type=raw,value=${{ steps.semver.outputs.next }} - name: Build and push id: buildPushAction - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64,linux/riscv64,linux/arm/v7,linux/arm/v6 context: . diff --git a/.github/workflows/deployment-weekly-release.yml b/.github/workflows/deployment-weekly-release.yml new file mode 100644 index 000000000..e45cc5b69 --- /dev/null +++ b/.github/workflows/deployment-weekly-release.yml @@ -0,0 +1,82 @@ +name: "[Deployment] Automatic Weekly Release" + +on: + schedule: + - cron: "0 19 * * 5" # https://crontab.guru/#0_19_*_*_5 + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + create-and-merge-pr: + runs-on: ubuntu-latest + steps: + - name: Discord notification + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + uses: Ilshidur/action-discord@master + with: + args: "Automatic release has been triggered: [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get Next Version + id: semver + uses: ietf-tools/semver-action@v1 + with: + token: ${{ github.token }} + branch: dev + - name: Create pull request + uses: devops-infra/action-pull-request@v0.5.5 + id: create-pull-request + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + title: "chore(release): automatic release ${{ steps.semver.outputs.next }}" + new_string: "**This is an automatic release**.
Manual action may be required for major bumps.
Detected change to be ``${{ steps.semver.outputs.bump }}``
Bump version from ``${{ steps.semver.outputs.current }}`` to ``${{ steps.semver.outputs.next }}``" + source_branch: dev + target_branch: main + label: automerge + - name: Discord notification + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + uses: Ilshidur/action-discord@master + with: + args: "Created a release PR ${{ steps.create-pull-request.outputs.url }} for version ${{ steps.semver.outputs.next }} (new behaviour: ${{ steps.semver.outputs.bump }})" + - id: automerge + if: ${{ steps.semver.outputs.bump != 'major' }} + name: automerge + uses: "pascalgn/automerge-action@v0.16.3" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + MERGE_METHOD: merge # we prefer merge commits for merging to master + MERGE_COMMIT_MESSAGE: "chore(release): automatic release ${{ steps.semver.outputs.next }}" + MERGE_DELETE_BRANCH: false # never set to true! + PULL_REQUEST: "${{ steps.create-pull-request.outputs.pr_number }}" + MERGE_RETRIES: 20 # 20 retries * MERGE_RETRY_SLEEP until step fails + MERGE_RETRY_SLEEP: 10000 # 10 seconds * MERGE_RETRIES until step fails + MERGE_REQUIRED_APPROVALS: 0 # do not require approvals + + - name: Merged Discord notification + if: ${{ steps.automerge.outputs.mergeResult == 'merged' }} + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + uses: Ilshidur/action-discord@master + with: + args: "Merged PR ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}" + - name: Major Bump Discord notification + if: ${{ steps.semver.outputs.bump == 'major' }} + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + uses: Ilshidur/action-discord@master + with: + args: "The release PR must be manually merged because the next version is a major version: ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}" + - name: Discord Fail Notification + if: failure() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + uses: Ilshidur/action-discord@master + with: + args: "The automatic release workflow [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) has failed" diff --git a/.github/workflows/renovate-automatic-approval b/.github/workflows/renovate-automatic-approval.yml similarity index 56% rename from .github/workflows/renovate-automatic-approval rename to .github/workflows/renovate-automatic-approval.yml index b4701ed96..1185fd800 100644 --- a/.github/workflows/renovate-automatic-approval +++ b/.github/workflows/renovate-automatic-approval.yml @@ -1,4 +1,4 @@ -name: Approve Renovate PRs +name: "[Dependency Updates] Auto Approve" on: pull_request: types: [opened, synchronize] @@ -6,17 +6,20 @@ on: jobs: approve-renovate-prs: runs-on: ubuntu-latest - steps: - name: Checkout code - uses: actions/checkout@v2 - + uses: actions/checkout@v4 + - name: Obtain token + id: obtainToken + uses: tibdex/github-app-token@v2 + with: + private_key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }} + app_id: ${{ secrets.RENOVATE_APPROVE_APP_ID }} - name: Install GitHub CLI run: sudo apt-get install -y gh - - name: Approve Renovate PRs env: - GITHUB_TOKEN: ${{ secrets.RENOVATE_APPROVE_TOKEN }} + GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }} run: | for pr in $(gh pr list --author homarr-renovate[bot] --json number --jq .[].number); do gh pr review $pr --approve --body "Automatically approved by GitHub Action" diff --git a/.gitignore b/.gitignore index 8327c8b84..f7d87aa53 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,8 @@ coverage out/ next-env.d.ts -# nest.js -apps/nestjs/dist +# artifacts +packages/db/migrations/*/migrate.cjs # nitro .nitro/ diff --git a/.nvmrc b/.nvmrc index 48b14e6b2..907565957 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.14.0 +20.15.0 diff --git a/.run/db_migration_mysql_generate.run.xml b/.run/db_migration_mysql_generate.run.xml new file mode 100644 index 000000000..1eaa49077 --- /dev/null +++ b/.run/db_migration_mysql_generate.run.xml @@ -0,0 +1,13 @@ + + + + + +