Skip to content

authors in Hebrew

authors in Hebrew #32

name: Update Library and create manifest
on:
push:
branches:
- main
- master
paths:
- Ben-YehudaToOtzaria/ספרים/אוצריא/**
- DictaToOtzaria/ספרים/ערוך/אוצריא/**
- OnYourWayToOtzaria/ספרים/אוצריא/**
- OraytaToOtzaria/ספרים/אוצריא/**
- sefariaToOtzaria/ספרים/אוצריא/**
- sefaria and more/**
workflow_dispatch:
jobs:
update-manifest:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' && github.actor != 'github-actions'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install bs4 requests pyluach
- name: Sync files and folders
run: |
python sync_and_merge_folders.py
- name: Generate Files Manifest
run: |
echo "{" > files_manifest.json
find . \( -path "./metadata.json" -o -path "./אוצריא/*" -o -path "./links/*" \) -type f \
! -path "./.git/*" \
! -path "./.github/*" \
! -name "files_manifest.json" \
-exec sh -c '
path="${1#./}"
hash=$(sha256sum "$1" | cut -d" " -f1)
echo "\"$path\": {\"hash\": \"$hash\"}"
' sh {} \; | sed "$ ! s/$/,/" >> files_manifest.json
echo "}" >> files_manifest.json
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: "Update files manifest and sync folders"
default_author: github_actions
- name: update in mitmachim
env:
USER_NAME: ${{ secrets.USER_NAME }}
PASSWORD: ${{ secrets.PASSWORD }}
TOKEN_YEMOT: ${{ secrets.TOKEN_YEMOT }}
run: |
python send_update/main.py
- name: Create Release Archive
run: |
zip -r otzaria_latest.zip אוצריא links files_manifest.json metadata.json
- name: Delete existing 'latest' release and tag
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete latest --yes || true
git push --delete origin latest || true
- name: Create and push new tag # שלב חדש שנוסף כאן!
run: |
git tag -f latest
git push origin latest --force
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create latest \
--title "Latest Otzaria Files" \
--notes "Latest version of Otzaria files" \
otzaria_latest.zip