diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1573c215a1f6..8a9fb365a1e3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,15 +1,16 @@ name: Publish on: - push: - branches: - - main - workflow_dispatch: + pull_request: +# push: +# branches: +# - main +# workflow_dispatch: -permissions: - contents: read - pages: write - id-token: write +#permissions: +# contents: read +# pages: write +# id-token: write # Allow one concurrent deployment concurrency: @@ -23,13 +24,15 @@ env: jobs: publish: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} +# environment: +# name: github-pages +# url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch full history - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache @@ -47,22 +50,35 @@ jobs: run: | for po_lang in ${{ env.LANGUAGES }}; do echo "::group::Building $po_lang translation" + POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/') + if [[ $POT_CREATION_DATE == "" ]]; then + echo "Restoring back to start" + git log -1 + git restore src/ + else + echo "Restoring to $POT_CREATION_DATE" + git log -1 --before "$POT_CREATION_DATE" + git restore --source "@{$POT_CREATION_DATE}" src/ + fi + echo "Status:" + git status + MDBOOK_BOOK__LANGUAGE=$po_lang \ MDBOOK_OUTPUT__HTML__SITE_URL=/comprehensive-rust/$po_lang/ \ mdbook build -d book/$po_lang - (cd book/$po_lang/exerciser && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/) + #(cd book/$po_lang/exerciser && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/) mv book/$po_lang/html book/html/$po_lang echo "::endgroup::" done - - name: Setup Pages - uses: actions/configure-pages@v2 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: book/html - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 +# - name: Setup Pages +# uses: actions/configure-pages@v2 +# +# - name: Upload artifact +# uses: actions/upload-pages-artifact@v1 +# with: +# path: book/html +# +# - name: Deploy to GitHub Pages +# id: deployment +# uses: actions/deploy-pages@v1 diff --git a/po/da.po b/po/da.po index 5c5bf87b0cbe..6b235342480a 100644 --- a/po/da.po +++ b/po/da.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-24T14:16:08+02:00\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/po/ko.po b/po/ko.po index 4ead7487e525..61e313535dfb 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: [한국어]Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-24T14:16:08+02:00\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n"