filter with new dataclass #2230
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
on: | |
push: | |
permissions: read-all | |
jobs: | |
get_commit: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-20.04 | |
outputs: | |
long: ${{ steps.commit.outputs.long}} | |
short: ${{ steps.commit.outputs.short}} | |
hash: ${{ steps.commit.outputs.hash}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: commit | |
uses: pr-mpt/actions-commit-hash@v2 | |
id: commit | |
create_version: | |
needs: [get_commit] | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-20.04 | |
name: create version doc | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: commit | |
uses: pr-mpt/actions-commit-hash@v2 | |
id: commit | |
- name: Set up Python 3.11.5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.5 | |
- name: install dunamai | |
run: pip install dunamai | |
- name: print version | |
run: dunamai from git --format "{base}+{branch}.{commit}" --pattern "(?P<base>\d+\.\d+(\.((\d+\.\w+)|\w+)|))" | |
- name: replace_version | |
run: | | |
sed -i -e s/'[^ ]*hardcoded__.*None'/__hardcoded__="\"$(dunamai from git --format "{base}+{branch}.{commit}" --pattern "(?P<base>\d+\.\d+(\.((\d+\.\w+)|\w+)|))")\""/ ofscraper/__version__.py | |
- name: show file | |
run: cat ofscraper/__version__.py | |
- name: upload release file | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/upload-artifact@v4 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: /home/runner/work/OF-Scraper/OF-Scraper/ofscraper/__version__.py | |
overwrite: true | |
linux_file: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
needs: [create_version, get_commit] | |
runs-on: ubuntu-20.04 | |
name: create linux release file | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: list files | |
run: ls -d $PWD/* | |
- name: list files2 | |
run: ls -d $PWD/ofscraper/* | |
- name: replace version.py | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/download-artifact@v4 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: ofscraper | |
- name: create one file | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: datawhores/ubuntu:latest | |
options: -v ${{ github.workspace }}:/root/work | |
shell: bash | |
run: | | |
cd work | |
rm -rf ./ofscraper/dist | |
rm -rf ./ofscraper/build | |
apt-get install zip libxml2-dev libxslt-dev -y | |
python3.11 -m venv .venv | |
source .venv/bin/activate | |
python3.11 -m pip install pyinstaller==6.10.0 | |
/root/.local/bin/poetry install | |
echo "ls files" | |
ls . | |
echo "test ofscraper" | |
ofscraper -h | |
echo "install run pyinstaller dir" | |
pyinstaller ./ofscraper/__main__.py --name "ofscraper_linux_${{needs.get_commit.outputs.short}}" --onefile | |
echo "list files dir" | |
ls dist | |
- name: upload file | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/upload-artifact@v4 | |
with: | | |
name: ofscraper_linux_${{needs.get_commit.outputs.short}} | |
path: "dist/ofscraper_linux_${{needs.get_commit.outputs.short}}" | |
overwrite: true | |
linux_dir: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
needs: [create_version, get_commit] | |
runs-on: ubuntu-20.04 | |
name: create linux release zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: list files | |
run: ls -d $PWD/* | |
- name: list files2 | |
run: ls -d $PWD/ofscraper/* | |
- name: replace version.py | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/download-artifact@v4 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: ofscraper | |
- name: create zip | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: datawhores/ubuntu:latest | |
options: -v ${{ github.workspace }}:/root/work | |
shell: bash | |
run: | | |
cd work | |
rm -rf ./ofscraper/dist | |
rm -rf ./ofscraper/build | |
apt-get install zip libxml2-dev libxslt-dev -y | |
python3.11 -m venv .venv | |
source .venv/bin/activate | |
python3.11 -m pip install pyinstaller==6.10.0 | |
/root/.local/bin/poetry install | |
echo "ls files" | |
ls . | |
echo "test ofscraper" | |
ofscraper -h | |
echo "run pyinstaller dir" | |
pyinstaller ./ofscraper/__main__.py --name "ofscraper_linux_${{needs.get_commit.outputs.short}}" | |
echo "list one dir" | |
ls dist | |
zip -r "dist/ofscraper_linux_${{needs.get_commit.outputs.short}}.zip" "dist/ofscraper_linux_${{needs.get_commit.outputs.short}}" | |
- name: upload one file | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/upload-artifact@v4 | |
with: | | |
name: "ofscraper_linux_zip_${{needs.get_commit.outputs.short}}" | |
path: "dist/ofscraper_linux_${{needs.get_commit.outputs.short}}.zip" | |
overwrite: true | |
windows_dir: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
needs: [create_version, get_commit] | |
runs-on: windows-latest | |
name: create windows release zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: list files | |
run: ls . | |
- name: list files2 | |
run: ls ofscraper | |
- name: commit | |
uses: pr-mpt/actions-commit-hash@v2 | |
id: commit | |
- name: replace version.py | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/download-artifact@v4 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: ofscraper | |
- name: Set up Python 3.11.5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.5 | |
- name: install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.4.1 | |
- name: create virtualenv | |
run: python3 -m venv .venv | |
- name: install ofscraper windows | |
run: | | |
.venv\Scripts\activate.bat | |
pip install . | |
.venv\Scripts\deactivate.bat | |
- name: Install pyinstaller | |
run: | | |
.venv\Scripts\activate.bat | |
pip install pyinstaller==6.10.0 | |
.venv\Scripts\deactivate.bat | |
- name: test ofscraper | |
run: | | |
.venv\Scripts\activate.bat | |
ofscraper -h | |
- name: create-dir | |
id: create-dir | |
run: | | |
.venv\Scripts\activate.bat | |
pyinstaller ofscraper\__main__.py --collect-submodules ofscraper --name "ofscraper_windows_${{needs.get_commit.outputs.short}}" --paths . --clean --log DEBUG | |
continue-on-error: true | |
- name: create-dir2 | |
if: steps.create-dir.outcome != 'success' | |
run: | | |
.venv\Scripts\activate.bat | |
pyinstaller .venv/Scripts/ofscraper --collect-submodules ofscrape --name "ofscraper_windows_${{needs.get_commit.outputs.short}}" --paths ofscraper --clean --log DEBUG | |
- uses: vimtor/action-zip@v1 | |
with: | |
files: "dist/ofscraper_windows_${{needs.get_commit.outputs.short}}" | |
dest: "dist/ofscraper_windows_${{needs.get_commit.outputs.short}}.zip" | |
- name: upload one file | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/upload-artifact@v4 | |
with: | | |
name: ofscraper_windows_zip_${{needs.get_commit.outputs.short}} | |
path: "dist/ofscraper_windows_${{needs.get_commit.outputs.short}}.zip" | |
overwrite: true | |
windows_file: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
needs: [create_version, get_commit] | |
runs-on: windows-latest | |
name: create windows release file | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: list files | |
run: ls . | |
- name: list files2 | |
run: ls ofscraper | |
- name: replace version.py | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/download-artifact@v4 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: ofscraper | |
- name: Set up Python 3.11.5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.5 | |
- name: install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.4.1 | |
- name: create virtualenv | |
run: python3 -m venv .venv | |
- name: install ofscraper windows | |
run: | | |
.venv\Scripts\activate.bat | |
pip install . | |
.venv\Scripts\deactivate.bat | |
- name: Install pyinstaller | |
run: | | |
.venv\Scripts\activate.bat | |
pip install pyinstaller==6.10.0 | |
.venv\Scripts\deactivate.bat | |
- name: test ofscraper | |
run: ofscraper -h | |
- name: create-one-file | |
id: create-one-file | |
run: | | |
.venv\Scripts\activate.bat | |
pyinstaller ofscraper\__main__.py --collect-submodules ofscraper --onefile --name "ofscraper_windows_${{needs.get_commit.outputs.short}}" -p ofscraper --clean --log DEBUG | |
.venv\Scripts\deactivate.bat | |
continue-on-error: true | |
- name: create-one-file2 | |
if: steps.create-one-file.outcome != 'success' | |
run: | | |
.venv\Scripts\activate.bat | |
pyinstaller .venv/Scripts/ofscraper --onefile --collect-submodules ofscraper --name "ofscraper_windows_${{needs.get_commit.outputs.short}}" -p ofscraper --clean --log DEBUG | |
.venv\Scripts\deactivate.bat | |
- name: upload one file | |
uses: Wandalen/wretry.action@master | |
with: | |
attempt_limit: 3 | |
action: actions/upload-artifact@v4 | |
with: | | |
path: "dist/ofscraper_windows_${{needs.get_commit.outputs.short}}.exe" | |
name: ofscraper_windows_${{needs.get_commit.outputs.short}} | |
overwrite: true | |
mac_file: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
needs: [create_version, get_commit] | |
runs-on: macos-latest | |
name: create mac release file | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: list files | |
run: ls -d $PWD/* | |
- name: list files2 | |
run: ls -d $PWD/ofscraper/* | |
- name: replace version.py | |
uses: Wandalen/wretry.action@master | |
with: | |
action: actions/download-artifact@v4 | |
attempt_limit: 3 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: ofscraper | |
- name: Set up Python 3.11.5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.5 | |
- name: create virtualenv | |
run: python3 -m venv .venv | |
- name: install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.4.1 | |
- name: Install package | |
run: | | |
source .venv/bin/activate | |
pip install . -vvv | |
deactivate | |
- name: Install pyinstaller | |
run: | | |
source .venv/bin/activate | |
pip install pyinstaller==6.10.0 | |
deactivate | |
- name: test ofscraper | |
run: | | |
export PATH=$PATH:/usr/local/bin | |
/Users/runner/work/OF-Scraper/OF-Scraper/.venv/bin/ofscraper -h | |
- name: create-one-file | |
id: create-one-file | |
run: | | |
rm -rf dist | |
rm -rf build | |
source .venv/bin/activate | |
export PATH=$PATH:/usr/local/bin | |
pyinstaller /Users/runner/work/OF-Scraper/OF-Scraper/ofscraper/__main__.py --collect-submodules /Users/runner/work/OF-Scraper/OF-Scraper/.venv/bin/ofscraper --onefile --name "ofscraper_macos_${{needs.get_commit.outputs.short}}" | |
deactivate | |
continue-on-error: true | |
- name: create-one-file2 | |
id: create-one-file2 | |
if: steps.create-one-file.outcome != 'success' | |
run: | | |
rm -rf dist | |
rm -rf build | |
source .venv/bin/activate | |
poetry run pyinstaller .venv/bin/ofscraper --onefile --name "ofscraper_macos_${{needs.get_commit.outputs.short}}" | |
deactivate | |
- name: upload file | |
uses: Wandalen/wretry.action@master | |
with: | |
action: actions/upload-artifact@v4 | |
attempt_limit: 3 | |
with: | | |
name: ofscraper_macos_${{needs.get_commit.outputs.short}} | |
path: "dist/ofscraper_macos_${{needs.get_commit.outputs.short}}" | |
overwrite: true | |
mac_dir: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
needs: [create_version, get_commit] | |
runs-on: macos-latest | |
name: create mac release zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- run: git checkout ${{needs.get_commit.outputs.long}} | |
- name: list files | |
run: ls -d $PWD/* | |
- name: list files2 | |
run: ls -d $PWD/ofscraper/* | |
- name: replace version.py | |
uses: Wandalen/wretry.action@master | |
with: | |
action: actions/download-artifact@v4 | |
attempt_limit: 3 | |
with: | | |
name: ofscraper_version_${{needs.get_commit.outputs.short}} | |
path: ofscraper | |
- name: Set up Python 3.11.5 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.5 | |
- name: create virtualenv | |
run: python3 -m venv .venv | |
- name: install poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.4.1 | |
- name: Install package | |
run: | | |
source .venv/bin/activate | |
pip install . -vvv | |
deactivate | |
- name: Install pyinstaller | |
run: | | |
source .venv/bin/activate | |
pip install pyinstaller==6.10.0 | |
deactivate | |
- name: test ofscraper | |
run: | | |
export PATH=$PATH:/usr/local/bin | |
/Users/runner/work/OF-Scraper/OF-Scraper/.venv/bin/ofscraper -h | |
- name: create-dir | |
id: create-dir | |
run: | | |
rm -rf dist | |
rm -rf build | |
source .venv/bin/activate | |
pyinstaller /Users/runner/work/OF-Scraper/OF-Scraper/ofscraper/__main__.py --name "ofscraper_macos_${{needs.get_commit.outputs.short}}" | |
deactivate | |
continue-on-error: true | |
- name: create-dir2 | |
id: create-dir2 | |
if: steps.create-dir.outcome != 'success' | |
run: | | |
rm -rf dist | |
rm -rf build | |
source .venv/bin/activate | |
poetry run pyinstaller .venv/bin/ofscraper --name "ofscraper_macos_${{needs.get_commit.outputs.short}}" | |
deactivate | |
- uses: vimtor/action-zip@v1 | |
with: | |
files: "dist/ofscraper_macos_${{needs.get_commit.outputs.short}}" | |
dest: "dist/ofscraper_macos_${{needs.get_commit.outputs.short}}.zip" | |
- name: upload zip | |
uses: Wandalen/wretry.action@master | |
with: | |
action: actions/upload-artifact@v4 | |
with: | | |
name: ofscraper_macos_zip_${{needs.get_commit.outputs.short}} | |
path: "dist/ofscraper_macos_${{needs.get_commit.outputs.short}}.zip" | |
overwrite: true | |
publish_release: | |
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
name: publish | |
needs: | |
[ | |
mac_file, | |
mac_dir, | |
windows_dir, | |
windows_file, | |
linux_file, | |
linux_dir, | |
get_commit, | |
] | |
permissions: | |
contents: write | |
steps: | |
# # - name: download linux | |
# # uses: Wandalen/wretry.action@master | |
# # with: | |
# # attempt_limit: 3 | |
# # action: actions/download-artifact@v4 | |
# # with: | | |
# # name: ofscraper_linux_${{needs.get_commit.outputs.short}} | |
# # - name: download linux zip | |
# # uses: Wandalen/wretry.action@master | |
# with: | |
# attempt_limit: 3 | |
# action: actions/download-artifact@v4 | |
# with: | | |
# name: ofscraper_linux_zip_${{needs.get_commit.outputs.short}} | |
# - name: download linx | |
# uses: Wandalen/wretry.action@master | |
# with: | |
# attempt_limit: 3 | |
# action: actions/download-artifact@v4 | |
# with: | | |
# name: ofscraper_macos_${{needs.get_commit.outputs.short}} | |
# - name: download mac zip | |
# uses: Wandalen/wretry.action@master | |
# with: | |
# attempt_limit: 3 | |
# action: actions/download-artifact@v4 | |
# with: | | |
# name: ofscraper_macos_zip_${{needs.get_commit.outputs.short}} | |
# - name: download windows | |
# uses: Wandalen/wretry.action@master | |
# with: | |
# attempt_limit: 3 | |
# action: actions/download-artifact@v4 | |
# with: | | |
# name: ofscraper_windows_${{needs.get_commit.outputs.short}} | |
# - name: download windows zip | |
# uses: Wandalen/wretry.action@master | |
# with: | |
# attempt_limit: 3 | |
# action: actions/download-artifact@v4 | |
# with: | | |
# name: ofscraper_windows_zip_${{needs.get_commit.outputs.short}} | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y.%m.%d')_$(date +%s| tail -c 7)" >> $GITHUB_OUTPUT | |
- name: create release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: /home/runner/work/OF-Scraper/OF-Scraper/ofscraper_* | |
tag: "${{needs.get_commit.outputs.short}}" | |
name: ${{env.name}} | |
body: ${{env.body}} | |
commit: "${{needs.get_commit.outputs.long}}" | |
env: | |
name: "${{steps.date.outputs.date}}_${{ github.head_ref || github.ref_name }}_${{needs.get_commit.outputs.short}}_package" | |
body: "This is a auto generated release created from commit ${{ needs.get_commit.outputs.hash}}" |