chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 (#90) #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate and publish translations to releases | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
schedule: | |
# This will run at 00:00 UTC on the first day of every month | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
translations: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to upload assets to releases | |
attestations: write # to upload assets attestation for build provenance | |
id-token: write # grant additional permission to attestation action to mint the OIDC token permission | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Fetch sources | |
run: | | |
wget https://github.com/tldr-pages/tldr/archive/refs/heads/main.zip --output-document /tmp/main.zip | |
unzip /tmp/main.zip -d /tmp | |
- name: Generate CSV dataset | |
run: | | |
npm run tldr-translation-pairs-gen -- --source /tmp/tldr-main --output tldr-translation-pairs-dataset-csv --format csv | |
zip tldr-translations-dataset-csv.zip tldr-translation-pairs-dataset-csv/* | |
- name: Generate TMX dataset | |
run: | | |
npm run tldr-translation-pairs-gen -- --source /tmp/tldr-main --output tldr-translation-pairs-dataset-tmx --format tmx | |
zip tldr-translations-dataset-tmx.zip tldr-translation-pairs-dataset-tmx/* | |
- name: Generate JSON dataset | |
run: | | |
npm run tldr-translation-pairs-gen -- --source /tmp/tldr-main --output tldr-translation-pairs-dataset-json --format json | |
zip tldr-translations-dataset-json.zip tldr-translation-pairs-dataset-json/* | |
- name: Generate XML dataset | |
run: | | |
npm run tldr-translation-pairs-gen -- --source /tmp/tldr-main --output tldr-translation-pairs-dataset-xml --format xml | |
zip tldr-translations-dataset-xml.zip tldr-translation-pairs-dataset-xml/* | |
- name: Deploy to Release | |
if: github.repository == 'tldr-pages/tldr-translation-pairs-gen' && github.ref == 'refs/heads/main' | |
run: | | |
export RELEASE_TAG="$(git describe --tags --abbrev=0)" | |
gh release --repo tldr-pages/tldr-translation-pairs-gen upload --clobber "$RELEASE_TAG" -- *.zip | |
- name: Attest generated files | |
if: github.repository == 'tldr-pages/tldr-translation-pairs-gen' && github.ref == 'refs/heads/main' | |
id: attest | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: '*.zip' |