Moved workflow from pr to push pipeline
This commit is contained in:
@@ -99,7 +99,6 @@ jobs:
|
||||
|
||||
generate_licenses:
|
||||
runs-on: ubuntu-latest
|
||||
needs: update_version
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -144,9 +143,65 @@ jobs:
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
|
||||
generate_localizations:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Required for Flutter action
|
||||
- name: Install jq
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y jq
|
||||
|
||||
- name: Set up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
flutter-version: 3.41.0
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
|
||||
flutter pub get
|
||||
|
||||
- name: Generate localizations
|
||||
run: flutter gen-l10n --no-use-deferred-loading
|
||||
|
||||
- name: Check for changes
|
||||
id: generate_localizations
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain lib/l10n)" ]; then
|
||||
echo "has_changes=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "has_changes=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Commit generated localizations
|
||||
if: steps.generate_localizations.outputs.has_changes == 'true'
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
BRANCH_NAME: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
git fetch origin "$BRANCH_NAME"
|
||||
git checkout "$BRANCH_NAME"
|
||||
|
||||
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 config pull.rebase false
|
||||
git pull origin "$BRANCH_NAME"
|
||||
git add lib/l10n
|
||||
git commit -m "Generated localizations [skip ci]"
|
||||
git push origin "HEAD:$BRANCH_NAME"
|
||||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [update_version, generate_licenses]
|
||||
needs: [update_version, generate_licenses, generate_localizations]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user