From b184b503c3d5cbaf0d7225c7778752f6419411cf Mon Sep 17 00:00:00 2001 From: LucaZanni Date: Thu, 26 Mar 2026 14:58:27 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(workflows):=20rimuovi=20wo?= =?UTF-8?q?rkflow=20release=20non=20pi=C3=B9=20necessario=20-=20elimina=20?= =?UTF-8?q?il=20file=20release.yml=20perch=C3=A9=20non=20pi=C3=B9=20utiliz?= =?UTF-8?q?zato=20nel=20flusso=20di=20lavoro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 chore(ci): aggiorna trigger workflow CI - aggiungi supporto per pull request su main - ignora file markdown e cartella docs nei trigger - migliora gestione delle branch monitorate --- .gitea/workflows/release.yml | 86 ------------------------------------ examples/capacitor/ci.yml | 10 ++++- 2 files changed, 8 insertions(+), 88 deletions(-) delete mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml deleted file mode 100644 index b2fa591..0000000 --- a/.gitea/workflows/release.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Release - -# Workflow standalone — gira nel repo shared-actions stesso. -# Trigger: git tag v* (es. v1.0.0, v1.1.0) -# -# Uso: -# git tag v1.0.0 -# git push origin v1.0.0 -# -# I consumer dei workflow riutilizzabili possono poi usare: -# uses: https://gitea.com/Punga78/shared-actions/.gitea/workflows/quality-gates.yml@v1.0.0 -# oppure il tag major floating (aggiornato ad ogni release): -# uses: https://gitea.com/Punga78/shared-actions/.gitea/workflows/quality-gates.yml@v1 - -on: - push: - tags: - - 'v*' - -jobs: - create-release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: https://gitea.com/actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate changelog - id: changelog - env: - CURRENT_TAG: ${{ gitea.ref_name }} - run: | - PREV_TAG=$(git tag --sort=-version:refname | grep -v "^${CURRENT_TAG}$" | head -1) - if [ -z "$PREV_TAG" ]; then - git log --pretty=format:"- %s (%h)" > /tmp/changelog.txt - else - git log "${PREV_TAG}..${CURRENT_TAG}" --pretty=format:"- %s (%h)" > /tmp/changelog.txt - fi - echo "prev_tag=${PREV_TAG}" >> $GITHUB_OUTPUT - - - name: Create Gitea release - env: - GITEA_TOKEN: ${{ gitea.token }} - SERVER_URL: ${{ gitea.server_url }} - REPOSITORY: ${{ gitea.repository }} - CURRENT_TAG: ${{ gitea.ref_name }} - PREV_TAG: ${{ steps.changelog.outputs.prev_tag }} - run: | - CHANGELOG=$(cat /tmp/changelog.txt) - if [ -n "$PREV_TAG" ]; then - COMPARE="**Full diff:** ${SERVER_URL}/${REPOSITORY}/compare/${PREV_TAG}...${CURRENT_TAG}" - else - COMPARE="" - fi - printf '## Changelog\n\n%s\n\n%s' "$CHANGELOG" "$COMPARE" > /tmp/body.md - curl -s -X POST \ - -H "Content-Type: application/json" \ - -H "Authorization: token $GITEA_TOKEN" \ - "${SERVER_URL}/api/v1/repos/${REPOSITORY}/releases" \ - -d "{ - \"tag_name\": \"${CURRENT_TAG}\", - \"name\": \"${CURRENT_TAG}\", - \"body\": $(jq -Rs . /tmp/body.md), - \"draft\": false, - \"prerelease\": false - }" - - - name: Update major version tag - env: - CURRENT_TAG: ${{ gitea.ref_name }} - GITEA_TOKEN: ${{ gitea.token }} - SERVER_URL: ${{ gitea.server_url }} - REPOSITORY: ${{ gitea.repository }} - run: | - MAJOR=$(echo "$CURRENT_TAG" | grep -oP '^v\d+') - SHA=$(git rev-parse HEAD) - # Elimina il tag major esistente e lo ricrea sul commit corrente - curl -s -X DELETE \ - -H "Authorization: token $GITEA_TOKEN" \ - "${SERVER_URL}/api/v1/repos/${REPOSITORY}/tags/${MAJOR}" || true - curl -s -X POST \ - -H "Content-Type: application/json" \ - -H "Authorization: token $GITEA_TOKEN" \ - "${SERVER_URL}/api/v1/repos/${REPOSITORY}/tags" \ - -d "{\"tag_name\": \"${MAJOR}\", \"target\": \"${SHA}\"}" diff --git a/examples/capacitor/ci.yml b/examples/capacitor/ci.yml index 45b48c4..e6eff85 100644 --- a/examples/capacitor/ci.yml +++ b/examples/capacitor/ci.yml @@ -8,9 +8,15 @@ name: CI on: push: - branches-ignore: + branches: - main - + paths-ignore: + - '**.md' + - 'docs/**' + pull_request: + branches: + - main + jobs: quality-gates: uses: https://gitea.com/Punga78/shared-actions/.gitea/workflows/quality-gates.yml@v1