GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-docs-pt-br/.github/workflows/sync.yml at main · python/python-docs-pt-br 187 lines (156 loc) · 5.91 KB / Copy pathsync.ymlFile metadata and controls187 lines (156 loc) · 5.91 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 name: Sync on: workflow_call: inputs: version: description: "Branch name corresponding to a Python version" required: true type: string tx_project: description: "Name of the Transifex translation project" required: true type: string secrets: tx_token: description: "Token required for interacting with Transifex API" required: false env: PYDOC_LANGUAGE: pt_BR PYDOC_TX_PROJECT: ${{ inputs.tx_project }} PYDOC_VERSION: ${{ inputs.version }} PYDOC_LANG_DIR: ${{ inputs.version }} TX_CLI_VERSION: '1.6.17' jobs: sync: runs-on: ubuntu-latest permissions: contents: read steps: # 1- Set up environment - name: Check out this repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Checkout this repository ${{ env.PYDOC_VERSION }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ env.PYDOC_VERSION }} path: ${{ env.PYDOC_LANG_DIR }} persist-credentials: false - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ inputs.version }} allow-prereleases: true cache: 'pip' # 2- Install dependencies - name: Install Transifex CLI tool run: | cd /usr/local/bin curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash -s -- v${TX_CLI_VERSION} - name: Install Python packages run: | python -m pip install -U pip python -m pip install -r requirements.txt - name: Install APT dependencies run: sudo apt update -y && sudo apt install gettext -y # 3- Pull translations - name: Generate updated .tx/config if: ${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} run: python scripts/generate_txconfig.py -p ./${PYDOC_LANG_DIR} ${PYDOC_TX_PROJECT} env: TX_TOKEN: ${{ secrets.tx_token }} - name: Pull translations from Transifex id: pull if: ${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} run: | # Clean up obsolete files find ./${PYDOC_LANG_DIR} -name '*.po' -exec rm {} \; ./scripts/pull_translations.sh env: TX_TOKEN: ${{ secrets.tx_token }} - name: Merge translations from newer branch if: inputs.tx_project != 'python-newest' # python-newest doesn't have a newer branch run: | newer_branch=${PYDOC_VERSION%%.*}.$((${PYDOC_VERSION##*.}+1)) git clone --depth 1 --single-branch --branch $newer_branch https://github.com/python/python-docs-pt-br ${newer_branch}-dir pomerge --from ./${newer_branch}-dir/{**/,}*.po --to ./${PYDOC_LANG_DIR}/{**/,}*.po rm -rf ./${newer_branch}-dir - name: powrap if: steps.pull.outcome == 'success' run: | cd ./${PYDOC_LANG_DIR} powrap *.po **/*.po - name: Update statistics if: always() run: | ./scripts/stats.py git -C ./${PYDOC_LANG_DIR} diff stats.json env: PYDOC_LANG_DIR: ${{ env.PYDOC_LANG_DIR }} - name: Update potodo.md if: always() run: | ./scripts/potodo.sh git -C ./${PYDOC_LANG_DIR} diff potodo.md env: PYDOC_LANG_DIR: ${{ env.PYDOC_LANG_DIR }} - name: Upload translation artifacts uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: python-${{ env.PYDOC_VERSION }} include-hidden-files: true if-no-files-found: error path: | ${{ env.PYDOC_LANG_DIR }}/.tx/config ${{ env.PYDOC_LANG_DIR }}/potodo.md ${{ env.PYDOC_LANG_DIR }}/stats.json ${{ env.PYDOC_LANG_DIR }}/*.po ${{ env.PYDOC_LANG_DIR }}/**/*.po commit: runs-on: ubuntu-latest needs: sync permissions: contents: write steps: # 1- Set up environment - name: Check out this repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Checkout this repository ${{ env.PYDOC_VERSION }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ env.PYDOC_VERSION }} path: ${{ env.PYDOC_LANG_DIR }} persist-credentials: false - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ inputs.version }} allow-prereleases: true cache: 'pip' - name: Install Python packages run: | python -m pip install -U pip python -m pip install -r requirements.txt # 2- Remove PO files and the download files (excluding obsolete) - name: Clean PO files run: find ${PYDOC_LANG_DIR} -name '*.po' | xargs -r rm - name: Download translation artifacts uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: python-${{ env.PYDOC_VERSION }} path: ${{ env.PYDOC_LANG_DIR }} # 3- Commit and push changed files depending on the event name - name: Commit run: ./scripts/commit.sh env: PYDOC_LANG_DIR: ${{ env.PYDOC_LANG_DIR }} - name: Push if: ${{ contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd ./${PYDOC_LANG_DIR} git remote set-url origin \ "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" git push |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |