Skip to content

Patch Nokogiri on Linux #52

Patch Nokogiri on Linux

Patch Nokogiri on Linux #52

name: 'Update output files'
on:
push:
branches:
- new-system
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
generate-po-artifacts:
name: Generate PO artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Archive po files as artifacts
uses: actions/upload-artifact@v4
with:
name: translation-po
path: po
generate-output:
name: Generate raw output
needs: generate-po-artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout Archotome
uses: actions/checkout@v4
with:
repository: 'mtimoustafa/Archotome'
- name: Download po files artifacts
uses: actions/download-artifact@v4
with:
name: translation-po
path: po
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Patch for Nokogiri # https://github.com/sparklemotion/nokogiri/issues/2430
run: apk add gcompat
- name: Generate output files
run: ruby archotome.rb -d "$(pwd)/"
- name: Archive output files as artifacts
uses: actions/upload-artifact@v4
with:
name: translation-output
path: Arabic
fix-output-rtl:
name: Fix output RTL
needs: generate-output
runs-on: ubuntu-latest
steps:
- name: Checkout rimworld-rtl-translation-tools
uses: actions/checkout@v4
with:
repository: 'mtimoustafa/rimworld-rtl-translation-tools'
- name: Download output files artifacts
uses: actions/download-artifact@v4
with:
name: translation-output
path: raw-output
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Fix Arabic strings
run: ./build_arabic.sh raw-output/ fixed-output/
- name: Archive fixed output files as artifacts
uses: actions/upload-artifact@v4
with:
name: translation-output-fixed
path: fixed-output
push-output:
needs: fix-output-rtl
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download output files artifacts
uses: actions/download-artifact@v4
with:
name: translation-output-fixed
path: Arabic
- name: Setup Git
uses: actions4git/setup-git@v1
- name: Git add output files
run: git add Arabic/
- name: Git commit output files
run: if [ -n "$(git diff --cached --exit-code)" ]; then git commit -m "Generate output file for changes"; fi
- name: Git push output files
run: git push