From a810dcd4720b88c1108490b76299b388e3456adf Mon Sep 17 00:00:00 2001 From: Gato Date: Mon, 25 May 2026 08:01:39 +0200 Subject: [PATCH 1/3] Modification ci --- .gitea/workflows/release.yml | 51 +++++++++++++++---------------- .gitea/workflows/sync-develop.yml | 37 ++++++++++++++++++++++ 2 files changed, 62 insertions(+), 26 deletions(-) create mode 100644 .gitea/workflows/sync-develop.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 9e524c0..fe4c354 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,38 +1,37 @@ name: Release on: - push: - branches: - - main + release: + types: [published] jobs: - bump-version: + docker: + name: Build & push Docker image runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: https://github.com/actions/checkout@v4 + + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + + - name: Login to Gitea container registry + uses: https://github.com/docker/login-action@v3 with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} + registry: git.goutailler-olivier.com + username: ${{ gitea.actor }} + password: ${{ secrets.RELEASE_TOKEN }} - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Set lowercase repo name + id: repo + run: echo "name=$(echo '${{ gitea.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + - name: Build and push + uses: https://github.com/docker/build-push-action@v6 with: - node-version: '22' - - - name: Configure git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Bump patch version - run: | - npm version patch -m "chore: bump version to %s [skip ci]" - - - name: Push version commit and tag - run: | - git push - git push --tags + context: . + push: true + tags: | + git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:${{ gitea.ref_name }} + git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:latest diff --git a/.gitea/workflows/sync-develop.yml b/.gitea/workflows/sync-develop.yml new file mode 100644 index 0000000..cb7cc34 --- /dev/null +++ b/.gitea/workflows/sync-develop.yml @@ -0,0 +1,37 @@ +name: Sync release into develop + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + sync-develop: + if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: https://github.com/actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.RELEASE_TOKEN }} + + - name: Install curl + run: apk add --no-cache curl + + - name: Create PR release → develop + run: | + RELEASE_BRANCH="${{ github.event.pull_request.head.ref }}" + + curl --fail-with-body -X POST \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{ + \"title\": \"chore: sync ${RELEASE_BRANCH} into develop\", + \"head\": \"${RELEASE_BRANCH}\", + \"base\": \"develop\", + \"body\": \"Synchronisation automatique après merge de ${RELEASE_BRANCH} dans main.\" + }" \ + "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/pulls" From 7af817510c6b80f36118f0c4c39d23ed12ab3981 Mon Sep 17 00:00:00 2001 From: Gato Date: Mon, 25 May 2026 08:12:24 +0200 Subject: [PATCH 2/3] Correction ci --- .gitea/workflows/sync-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/sync-develop.yml b/.gitea/workflows/sync-develop.yml index cb7cc34..d9f8168 100644 --- a/.gitea/workflows/sync-develop.yml +++ b/.gitea/workflows/sync-develop.yml @@ -34,4 +34,4 @@ jobs: \"base\": \"develop\", \"body\": \"Synchronisation automatique après merge de ${RELEASE_BRANCH} dans main.\" }" \ - "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/pulls" + "https://git.goutailler-olivier.com/api/v1/repos/${{ gitea.repository }}/pulls" From 612d5aa7ff9d3beabe0dfecba02c2dc3e14805ec Mon Sep 17 00:00:00 2001 From: Gato Date: Mon, 25 May 2026 08:19:31 +0200 Subject: [PATCH 3/3] Correction ci - 2 --- .gitea/workflows/sync-develop.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/sync-develop.yml b/.gitea/workflows/sync-develop.yml index d9f8168..6d07276 100644 --- a/.gitea/workflows/sync-develop.yml +++ b/.gitea/workflows/sync-develop.yml @@ -21,11 +21,19 @@ jobs: - name: Install curl run: apk add --no-cache curl + - name: Check API token access + run: | + STATUS=$(curl -s -o /tmp/api_response.json -w "%{http_code}" \ + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + "https://git.goutailler-olivier.com/api/v1/repos/${{ gitea.repository }}") + echo "GET /repos/${{ gitea.repository }} → HTTP $STATUS" + cat /tmp/api_response.json + - name: Create PR release → develop run: | RELEASE_BRANCH="${{ github.event.pull_request.head.ref }}" - curl --fail-with-body -X POST \ + STATUS=$(curl -s -o /tmp/pr_response.json -w "%{http_code}" -X POST \ -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ -H "Content-Type: application/json" \ -d "{ @@ -34,4 +42,7 @@ jobs: \"base\": \"develop\", \"body\": \"Synchronisation automatique après merge de ${RELEASE_BRANCH} dans main.\" }" \ - "https://git.goutailler-olivier.com/api/v1/repos/${{ gitea.repository }}/pulls" + "https://git.goutailler-olivier.com/api/v1/repos/${{ gitea.repository }}/pulls") + echo "POST /pulls → HTTP $STATUS" + cat /tmp/pr_response.json + [ "$STATUS" = "201" ] || exit 1