Skip to content

Merge pull request #222 from datawhores/dependabot/pip/urllib3-2.0.6 #550

Merge pull request #222 from datawhores/dependabot/pip/urllib3-2.0.6

Merge pull request #222 from datawhores/dependabot/pip/urllib3-2.0.6 #550

name: package builder commit
on:
push:
jobs:
create_version:
runs-on: ubuntu-20.04
name: create version doc
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.11.5
uses: actions/setup-python@v4
with:
python-version: '3.11.5'
- name: install dunamai
run: pip install dunamai
- name: replace_version
run: |
sed -i -e s/'from dunamai import Version,Pattern'// ofscraper/__version__.py
sed -i -e s/'Version.from_git(pattern=.*'/\""$(git from git --format "{base}+{branch}.{commit}" --pattern "(?P<base>\d+\.\d+\.\w+|\d+\.\w+)")"\"/ ofscraper/__version__.py
- name: show file
run: cat ofscraper/__version__.py
- name: upload file
uses: actions/upload-artifact@v3
with:
name: ofscraper_version
path: /home/runner/work/OF-Scraper/OF-Scraper/ofscraper/__version__.py
# - name: list files 1
# run: ls /home/runner/work/
# - name: list files 2
# run: ls /home/runner/work/OF-Scraper/
# - name: list files 3
# run: ls /home/runner/work/OF-Scraper/OF-Scraper
# - name: list files 4
# run: ls /home/runner/work/OF-Scraper/OF-Scraper/ofscraper
linux:
needs: [create_version]
runs-on: ubuntu-20.04
name: create linux release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: list files
run: ls -d $PWD/*
- name: list files2
run: ls -d $PWD/ofscraper/*
- name: commit
uses: pr-mpt/actions-commit-hash@v2
id: commit
- name: replace version.py
uses: actions/download-artifact@v3
with:
name: ofscraper_version
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
apt-get install zip libxml2-dev libxslt-dev -y
python3.11 -m venv .venv
/root/.local/bin/poetry install --with build
/root/.local/bin/poetry install
echo "install run pyinstaller"
/root/.local/bin/poetry run pyinstaller .venv/bin/ofscraper --collect-submodules application --name "ofscraper_linux_${{ steps.commit.outputs.short}}" --onefile
- name: upload one file
uses: actions/upload-artifact@v3
with:
name: ofscraper_linux
path: "dist/ofscraper_linux_${{ steps.commit.outputs.short}}"
- 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
apt-get install zip libxml2-dev libxslt-dev -y
python3.11 -m venv .venv
/root/.local/bin/poetry install --with build
/root/.local/bin/poetry install
/root/.local/bin/poetry run pyinstaller .venv/bin/ofscraper --collect-submodules application --name "ofscraper_linux_${{ steps.commit.outputs.short}}" --onefile
zip -r "dist/ofscraper_linux_${{steps.commit.outputs.short}}.zip" "dist/ofscraper_linux_${{steps.commit.outputs.short}}"
- name: upload one file
uses: actions/upload-artifact@v3
with:
name: ofscraper_linux_zip
path: "dist/ofscraper_linux_${{ steps.commit.outputs.short}}.zip"
windows:
needs: [create_version]
runs-on: windows-latest
name: create windows release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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: actions/download-artifact@v3
with:
name: ofscraper_version
path: ofscraper
- name: Set up Python 3.11.5
uses: actions/setup-python@v4
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: active env
run: poetry env use .venv/Scripts/python3
- name: Install package
run: poetry install
- name: Install builder
run: poetry add pyinstaller
# - name: temp deactive
# run: deactive
- name: create-one-file
id: create-one-file
run: poetry run pyinstaller D:\a\OF-Scraper\OF-Scraper\ofscraper\__main__.py --collect-submodules ofscraper --onefile --name "ofscraper_windows_${{ steps.commit.outputs.short}}"
continue-on-error: true
- name: active env for createfile2
run: poetry env use .venv/Scripts/python3
- name: create-one-file2
id: create-one-file2
if: steps.create-one-file.outcome != 'success'
run: poetry run pyinstaller .venv/Scripts/ofscraper --collect-submodules application --onefile --name "ofscraper_windows_${{ steps.commit.outputs.short}}"
- name: upload file
uses: actions/upload-artifact@v3
with:
name: ofscraper_windows
path: 'dist\ofscraper_windows_${{ steps.commit.outputs.short}}.exe'
# - name: temp deactive
# run: deactive
- name: create-dir
id: create-dir
run: poetry run pyinstaller D:\a\OF-Scraper\OF-Scraper\ofscraper\__main__.py --collect-submodules ofscraper --name "ofscraper_windows_${{steps.commit.outputs.short}}"
continue-on-error: true
- name: active env for create-dir2
run: poetry env use .venv/Scripts/python3
- name: create-dir2
id: create-one-dir2
if: steps.create-dir.outcome != 'success'
run: poetry run pyinstaller .venv/Scripts/ofscraper --collect-submodules application --name "ofscraper_windows_${{steps.commit.outputs.short}}"
- uses: vimtor/action-zip@v1
with:
files: "dist/ofscraper_windows_${{steps.commit.outputs.short}}"
dest: "dist/ofscraper_windows_${{steps.commit.outputs.short}}.zip"
- name: upload file
uses: actions/upload-artifact@v3
with:
name: ofscraper_windows_zip
path: "dist/ofscraper_windows_${{steps.commit.outputs.short}}.zip"
mac:
needs: [create_version]
runs-on: macos-latest
name: create mac release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: list files
run: ls -d $PWD/*
- name: list files2
run: ls -d $PWD/ofscraper/*
- name: commit
uses: pr-mpt/actions-commit-hash@v2
id: commit
- name: replace version.py
uses: actions/download-artifact@v3
with:
name: ofscraper_version
path: ofscraper
- name: Set up Python 3.11.5
uses: actions/setup-python@v4
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: poetry install
- name: Install builder
run: pip install pyinstaller
- name: create-one-file
id: create-one-file
run: poetry run pyinstaller /Users/runner/work/OF-Scraper/OF-Scraper/ofscraper/__main__.py --collect-submodules ofscraper --onefile --name "ofscraper_macos_${{ steps.commit.outputs.short}}"
continue-on-error: true
- name: create-one-file2
id: create-one-file2
if: steps.create-one-file.outcome != 'success'
run: poetry run pyinstaller .venv/bin/ofscraper --collect-submodules application --onefile --name "ofscraper_macos_${{ steps.commit.outputs.short}}"
- name: upload fille
uses: actions/upload-artifact@v3
with:
name: ofscraper_macos
path: "dist/ofscraper_macos_${{ steps.commit.outputs.short}}"
- name: create-dir
id: create-dir
run: poetry run pyinstaller /Users/runner/work/OF-Scraper/OF-Scraper/ofscraper/__main__.py --collect-submodules ofscraper --name "ofscraper_macos_${{ steps.commit.outputs.short}}"
continue-on-error: true
- name: create-dir2
id: create-dir2
if: steps.create-dir.outcome != 'success'
run: poetry run pyinstaller .venv/bin/ofscraper --collect-submodules application --name "ofscraper_macos_${{ steps.commit.outputs.short}}"
- uses: vimtor/action-zip@v1
with:
files: "dist/ofscraper_macos_${{ steps.commit.outputs.short}}"
dest: "dist/ofscraper_macos_${{ steps.commit.outputs.short}}.zip"
- name: upload file
uses: actions/upload-artifact@v3
with:
name: ofscraper_macos_zip
path: "dist/ofscraper_macos_${{steps.commit.outputs.short}}.zip"
publish_release:
runs-on: ubuntu-latest
name: publish
needs: [mac,windows,linux]
permissions:
contents: write
steps:
- name: Download linux
uses: actions/download-artifact@v3
with:
name: ofscraper_linux
- name: Download linux zip
uses: actions/download-artifact@v3
with:
name: ofscraper_linux_zip
- name: Download mac
uses: actions/download-artifact@v3
with:
name: ofscraper_macos
- name: Download mac zip
uses: actions/download-artifact@v3
with:
name: ofscraper_macos_zip
- name: Download windows
uses: actions/download-artifact@v3
with:
name: ofscraper_windows
- name: Download windows zip
uses: actions/download-artifact@v3
with:
name: ofscraper_windows_zip
- name: commit
uses: pr-mpt/actions-commit-hash@v2
id: commit
- name: Get current date
id: date
run: echo "date=$(date +'%Y.%m.%d_%H:%M')" >> $GITHUB_OUTPUT
- name: create release
uses: ncipollo/release-action@v1
with:
artifacts: "/home/runner/work/OF-Scraper/OF-Scraper/ofscraper_*"
tag: ${{steps.commit.outputs.short}}
name: ${{env.name}}
body: ${{env.body}}
env:
name: "${{steps.date.outputs.date}}_${{ github.head_ref || github.ref_name }}_${{ steps.commit.outputs.short}}_package"
body: "This is a auto generated release created from commit ${{ steps.commit.outputs.hash}}"