Skip to content

Commit

Permalink
Update repo template to test new .pot file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jan 25, 2025
1 parent c2fc9de commit 6185974
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.27
_src_path: git+https://github.com/OCA/oca-addons-repo-template
_commit: v1.1.2-270-g77e4444
_src_path: gh:acsone/oca-addons-repo-template
additional_ruff_rules: []
ci: GitHub
convert_readme_fragments_to_markdown: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Get python version
Expand Down
44 changes: 39 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install addons and dependencies
Expand All @@ -66,6 +66,40 @@ jobs:
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
- name: Prepare .pot files update
run: |
git reset --hard ${{ github.sha }}
oca_export_and_commit_pot
mkdir oca-ci-po-patch && touch oca-ci-po-patch/keep
git format-patch --output-directory=oca-ci-po-patch --keep-subject @{u}..@ */i18n/*.po*
if: matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA'
- uses: actions/upload-artifact@v4
with:
name: oca-ci-po-patch
path: oca-ci-po-patch
retention-days: 7
if: matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA'
push-pot:
needs: [test]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository_owner == 'OCA'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: oca-ci-po-patch
path: oca-ci-po-patch
- name: Configure git user
run: |
git config user.name "oca-ci"
git config user.email "[email protected]"
- name: Apply .pot files changes
run: git am --keep oca-ci-po-patch/*.patch
if: ${{ hashFiles('oca-ci-po-patch/*.patch') != '' }}
- name: Push .pot file changes
run: git push
if: ${{ hashFiles('oca-ci-po-patch/*.patch') != '' }}
# Don't fail in case something has changed upstream in the meantime
continue-on-error: true

0 comments on commit 6185974

Please sign in to comment.