From c7b4623198a085cb641fc026d3dcbe3ef73f4472 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 20 Jan 2026 10:48:49 +0000 Subject: [PATCH 1/7] Workflows um Format Stage erweitern (#175) Extend workflows with format stage Co-authored-by: Gitea Actions [bot] <> Reviewed-on: https://git.yannick-weigert.de/liquid-development/game-tracker/pulls/175 Reviewed-by: gelbeinhalb --- .gitea/workflows/pull_request.yaml | 28 +++----- .gitea/workflows/push.yaml | 103 +++++++++++++++++++++-------- 2 files changed, 86 insertions(+), 45 deletions(-) diff --git a/.gitea/workflows/pull_request.yaml b/.gitea/workflows/pull_request.yaml index 43d36d2..5b88cdf 100644 --- a/.gitea/workflows/pull_request.yaml +++ b/.gitea/workflows/pull_request.yaml @@ -6,23 +6,17 @@ on: jobs: lint: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install jq - run: | - apt-get update - apt-get install -y jq - - name: Install Flutter (wget) run: | - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz + wget --show-progress --progress=bar:force:noscroll:giga https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz tar xf flutter_linux_3.38.2-stable.tar.xz - # Set Git safe directory for Flutter path git config --global --add safe.directory "$(pwd)/flutter" - # Set Flutter path - echo "$(pwd)/flutter/bin" >> $GITHUB_PATH + echo "$(pwd)/flutter/bin" >> $GITEA_PATH - name: Get dependencies run: flutter pub get @@ -32,26 +26,22 @@ jobs: test: runs-on: ubuntu-latest + env: + RUNNER_TOOL_CACHE: /toolcache + steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install dependencies - run: | - apt-get update - apt-get install -y jq - - name: Install Flutter (wget) run: | - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz + wget --show-progress --progress=bar:force:noscroll:giga https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz tar xf flutter_linux_3.38.2-stable.tar.xz - # Set Git safe directory for Flutter path git config --global --add safe.directory "$(pwd)/flutter" - # Set Flutter path - echo "$(pwd)/flutter/bin" >> $GITHUB_PATH + echo "$(pwd)/flutter/bin" >> $GITEA_PATH - name: Get dependencies run: flutter pub get - name: Run tests - run: flutter test \ No newline at end of file + run: flutter test diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml index 700e96b..dfcee5f 100644 --- a/.gitea/workflows/push.yaml +++ b/.gitea/workflows/push.yaml @@ -7,44 +7,95 @@ on: - "main" jobs: - format: + test: runs-on: ubuntu-latest - if: false # Needs bot user steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install dependencies + - name: Install Flutter (wget) run: | - apt-get update - apt-get install -y jq + wget --show-progress --progress=bar:force:noscroll:giga https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz + tar xf flutter_linux_3.38.2-stable.tar.xz + git config --global --add safe.directory "$(pwd)/flutter" + echo "$(pwd)/flutter/bin" >> $GITEA_PATH + + - name: Get dependencies + run: flutter pub get + + - name: Run tests + run: flutter test + + format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Install Flutter (wget) run: | - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz + wget --show-progress --progress=bar:force:noscroll:giga https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz tar xf flutter_linux_3.38.2-stable.tar.xz - # Set Git safe directory for Flutter path git config --global --add safe.directory "$(pwd)/flutter" - # Set Flutter path - echo "$(pwd)/flutter/bin" >> $GITHUB_PATH + echo "$(pwd)/flutter/bin" >> $GITEA_PATH - - name: Get & upgrade dependencies - run: | - flutter pub get - flutter pub upgrade --major-versions + - name: Get dependencies + run: flutter pub get - - name: Auto-format - run: | - dart format lib - dart fix --apply lib + - name: Check code format + id: check_format + continue-on-error: true + run: flutter analyze lib test - # Needs credentials, push access and the right files need to be staged - - name: Commit Changes + - name: Format code + if: steps.check_format.outcome == 'failure' + env: + GITEA_TOKEN: ${{ secrets.BOT_TOKEN }} run: | - git config --global user.name "Gitea Actions" - git config --global user.email "actions@gitea.com" - git status - git add lib/ - git status - git commit -m "Actions: Auto-formatting [skip ci]" - git push + git fetch origin ${{ gitea.head_ref }} + git checkout ${{ gitea.head_ref }} + + dart fix --apply lib + dart fix --apply test + + if [ -n "$(git status --porcelain lib test)" ]; then + git config --global user.name "Gitea Actions [bot]" + git config --global user.email "actions@yannick-weigert.de" + git add lib test + git commit -m "Auto-format code [skip ci]" + git push origin HEAD:${{ gitea.head_ref }} + else + echo "No changes to commit" + fi + + - name: Verify format + run: flutter analyze lib test + + update_version: + runs-on: ubuntu-latest + needs: Format + if: gitea.ref == 'refs/heads/development' + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.BOT_TOKEN }} + ref: ${{ gitea.head_ref }} + + - name: Increment version number + uses: https://github.com/stikkyapp/update-pubspec-version@v2 + with: + strategy: 'patch' + path: './pubspec.yaml' + + + - name: Commit version update + env: + GITEA_TOKEN: ${{ secrets.BOT_TOKEN }} + run: | + git config --global user.name "Gitea Actions [bot]" + git config --global user.email "actions@yannick-weigert.de" + git add pubspec.yaml + git commit -m "Updated version number [skip ci]" + git push origin HEAD:${{ gitea.head_ref }} \ No newline at end of file From eb404f3ef20021763aeb7582390445823eb68bd7 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 20 Jan 2026 11:54:15 +0100 Subject: [PATCH 2/7] Fixed push pipeline --- .gitea/workflows/push.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml index dfcee5f..ca931b7 100644 --- a/.gitea/workflows/push.yaml +++ b/.gitea/workflows/push.yaml @@ -5,6 +5,7 @@ on: branches: - "development" - "main" + - "hotfix/*" jobs: test: @@ -63,7 +64,7 @@ jobs: git config --global user.email "actions@yannick-weigert.de" git add lib test git commit -m "Auto-format code [skip ci]" - git push origin HEAD:${{ gitea.head_ref }} + git push origin HEAD:${{ gitea.ref_name }} else echo "No changes to commit" fi @@ -98,4 +99,4 @@ jobs: git config --global user.email "actions@yannick-weigert.de" git add pubspec.yaml git commit -m "Updated version number [skip ci]" - git push origin HEAD:${{ gitea.head_ref }} \ No newline at end of file + git push origin HEAD:${{ gitea.ref_name }} \ No newline at end of file From e9929426e028df8bdd6a6be96354ff389c989f5e Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 20 Jan 2026 11:57:17 +0100 Subject: [PATCH 3/7] Removed development restriction --- .gitea/workflows/push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml index ca931b7..bcc94f0 100644 --- a/.gitea/workflows/push.yaml +++ b/.gitea/workflows/push.yaml @@ -75,7 +75,7 @@ jobs: update_version: runs-on: ubuntu-latest needs: Format - if: gitea.ref == 'refs/heads/development' + # if: gitea.ref == 'refs/heads/development' steps: - name: Checkout code uses: actions/checkout@v4 From 4c1c22123e6c995dd0f02ceaa623bb6a092bab0f Mon Sep 17 00:00:00 2001 From: "Gitea Actions [bot]" Date: Tue, 20 Jan 2026 10:59:27 +0000 Subject: [PATCH 4/7] Updated version number [skip ci] --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a2f8c9d..938c169 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: game_tracker description: "Game Tracking App for Card Games" publish_to: 'none' -version: 0.0.10+237 +version: 0.0.11+238 environment: sdk: ^3.8.1 From 057f8c1d588516a31fac45545457de3b3bfc42a9 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 20 Jan 2026 12:00:33 +0100 Subject: [PATCH 5/7] Changed workflow back to prod mode --- .gitea/workflows/push.yaml | 3 +-- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml index bcc94f0..63a3553 100644 --- a/.gitea/workflows/push.yaml +++ b/.gitea/workflows/push.yaml @@ -5,7 +5,6 @@ on: branches: - "development" - "main" - - "hotfix/*" jobs: test: @@ -75,7 +74,7 @@ jobs: update_version: runs-on: ubuntu-latest needs: Format - # if: gitea.ref == 'refs/heads/development' + if: gitea.ref == 'refs/heads/development' steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/pubspec.yaml b/pubspec.yaml index 938c169..0bb6c98 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: game_tracker description: "Game Tracking App for Card Games" publish_to: 'none' -version: 0.0.11+238 +version: 0.0.10+238 environment: sdk: ^3.8.1 From bc51b23563535dcb7318ea43c8a87d9b01a7be48 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 20 Jan 2026 12:03:31 +0100 Subject: [PATCH 6/7] Updated ref names --- .gitea/workflows/push.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml index 63a3553..20319e2 100644 --- a/.gitea/workflows/push.yaml +++ b/.gitea/workflows/push.yaml @@ -52,8 +52,8 @@ jobs: env: GITEA_TOKEN: ${{ secrets.BOT_TOKEN }} run: | - git fetch origin ${{ gitea.head_ref }} - git checkout ${{ gitea.head_ref }} + git fetch origin ${{ gitea.ref_name }} + git checkout ${{ gitea.ref_name }} dart fix --apply lib dart fix --apply test @@ -73,7 +73,7 @@ jobs: update_version: runs-on: ubuntu-latest - needs: Format + needs: format if: gitea.ref == 'refs/heads/development' steps: - name: Checkout code @@ -81,7 +81,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.BOT_TOKEN }} - ref: ${{ gitea.head_ref }} + ref: ${{ gitea.ref_name }} - name: Increment version number uses: https://github.com/stikkyapp/update-pubspec-version@v2 From 8ee2b6cb067cf082663339dac843bb4c0ff00547 Mon Sep 17 00:00:00 2001 From: "Gitea Actions [bot]" Date: Tue, 20 Jan 2026 14:55:05 +0000 Subject: [PATCH 7/7] Updated version number [skip ci] --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0bb6c98..c22d107 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: game_tracker description: "Game Tracking App for Card Games" publish_to: 'none' -version: 0.0.10+238 +version: 0.0.11+239 environment: sdk: ^3.8.1