From 9555eaf63695bf32fa5bb19ffd2220adcabc4c8a Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Sun, 12 Apr 2026 23:06:53 +0300 Subject: [PATCH] build: use remote workflow file --- .github/workflows/release.yml | 70 ++--------------------------------- 1 file changed, 3 insertions(+), 67 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 884b02e..d0429eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,73 +83,9 @@ jobs: release-please: needs: [lint, test] if: github.event_name == 'push' && github.ref == 'refs/heads/master' - runs-on: ubuntu-latest - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - version: ${{ steps.release.outputs.version }} - - steps: - - name: Release Please - id: release - uses: googleapis/release-please-action@v4 - with: - release-type: dart - - - name: Update fastlane changelog on release PR - if: ${{ steps.release.outputs.pr && !steps.release.outputs.release_created }} - env: - PR_JSON: ${{ steps.release.outputs.pr }} - run: | - PR_BRANCH=$(echo "$PR_JSON" | jq -r .headBranchName) - git clone --depth=5 --branch "$PR_BRANCH" \ - https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git _pr - cd _pr - - VERSION_LINE=$(grep '^version:' pubspec.yaml) - VERSION=$(echo "$VERSION_LINE" | sed 's/version: *//;s/+.*//') - CODE=$(echo "$VERSION_LINE" | sed 's/.*+//') - OUT_DIR="fastlane/metadata/android/en-US/changelogs" - OUT_FILE="$OUT_DIR/$CODE.txt" - - mkdir -p "$OUT_DIR" - - NOTES=$(awk " - /^## \\[${VERSION//./\\.}\\]/ { found=1; next } - /^## / { if (found) exit } - found { print } - " CHANGELOG.md) - - NOTES=$(echo "$NOTES" \ - | sed -E 's/ *\(\[[0-9a-f]+\]\([^)]+\)\)//g' \ - | sed -E 's/^\* \*\*[^*]+:\*\* */- /; s/^\* /- /' \ - | sed 's/^### //' \ - | sed '/^[[:space:]]*$/d') - - NOTES=$(echo "$NOTES" | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba;}') - [ -z "$NOTES" ] && NOTES="Release $VERSION" - - MAX=500 - TRAILER=$'\n\n… see full notes on GitHub.' - if [ ${#NOTES} -gt $MAX ]; then - BUDGET=$((MAX - ${#TRAILER})) - NOTES="${NOTES:0:$BUDGET}" - NOTES=$(echo "$NOTES" | sed '$d') - NOTES="${NOTES}${TRAILER}" - fi - - echo "$NOTES" > "$OUT_FILE" - echo "Wrote $OUT_FILE ($(wc -c < "$OUT_FILE") bytes)" - - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add "$OUT_DIR/" - if git diff --cached --quiet; then - echo "No changelog changes." - else - git commit --amend --no-edit - git push --force-with-lease - fi + uses: chenasraf/workflows/.github/workflows/release-please-fastlane-changelog.yml@master + with: + release-type: dart build-android: needs: release-please