update translators

This commit is contained in:
Carlos Polop 2024-12-31 18:30:25 +01:00
parent f3b5f906fe
commit 2ced196fe8
17 changed files with 741 additions and 67 deletions

66
.github/workflows/build_master.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Build Master
on:
push:
branches:
- master
paths-ignore:
- 'scripts/**'
- '.gitignore'
- '.github/**'
- 'book/**'
workflow_dispatch:
concurrency: build_master
permissions:
id-token: write
contents: write
jobs:
run-translation:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Cat hacktricks-preprocessor.log
#- name: Cat hacktricks-preprocessor.log
# run: cat hacktricks-preprocessor.log
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/en --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: af concurrency: af
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: de concurrency: de
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -1,4 +1,4 @@
name: Translator to GR (Greek) name: Translator to EL (Greek)
on: on:
push: push:
@ -12,6 +12,10 @@ on:
concurrency: el concurrency: el
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: es concurrency: es
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: fr concurrency: fr
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: in concurrency: in
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: it concurrency: it
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: ja concurrency: ja
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -1,4 +1,4 @@
name: Translator to KR (Korean) name: Translator to KO (Korean)
on: on:
push: push:
@ -12,6 +12,10 @@ on:
concurrency: ko concurrency: ko
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: pl concurrency: pl
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: pt concurrency: pt
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -1,4 +1,4 @@
name: Translator to RS (Serbian) name: Translator to SR (Serbian)
on: on:
push: push:
@ -12,6 +12,10 @@ on:
concurrency: sr concurrency: sr
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: sw concurrency: sw
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: tr concurrency: tr
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -1,4 +1,4 @@
name: Translator to UA (Ukranian) name: Translator to UK (Ukranian)
on: on:
push: push:
@ -10,7 +10,11 @@ on:
- '.github/**' - '.github/**'
workflow_dispatch: workflow_dispatch:
concurrency: ua concurrency: uk
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
@ -18,24 +22,42 @@ jobs:
environment: prod environment: prod
env: env:
LANGUAGE: Ukranian LANGUAGE: Ukranian
BRANCH: ua BRANCH: uk
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete

View File

@ -12,6 +12,10 @@ on:
concurrency: zh concurrency: zh
permissions:
id-token: write
contents: write
jobs: jobs:
run-translation: run-translation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -22,20 +26,38 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v2
with: with:
fetch-depth: 0 #Needed to download everything to be able to access the master & language branches fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install python dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip3 install openai tqdm tiktoken pip3 install openai tqdm tiktoken
# Install Rust and Cargo
- name: Install Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install mdBook and Plugins
- name: Install mdBook and Plugins
run: |
cargo install mdbook
cargo install mdbook-alerts
cargo install mdbook-reading-time
cargo install mdbook-pagetoc
cargo install mdbook-tabs
cargo install mdbook-codename
- name: Update & install wget & translator.py - name: Update & install wget & translator.py
run: | run: |
sudo apt-get update sudo apt-get update
@ -73,9 +95,25 @@ jobs:
echo "Translating $(cat /tmp/file_paths.txt)" echo "Translating $(cat /tmp/file_paths.txt)"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3 python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
# Push changes to the repository
- name: Commit and push changes - name: Commit and push changes
run: | run: |
git checkout "$BRANCH" git checkout "$BRANCH"
git add -A git add -A
git commit -m "Translated $BRANCH files" || true git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH" git push --set-upstream origin "$BRANCH"
# Build the mdBook
- name: Build mdBook
run: mdbook build
# Login in AWs
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
# Sync the build to S3
- name: Sync to S3
run: aws s3 sync ./book s3://hacktricks-wiki/$BRANCH --delete