feat(helper): Implement concurrent calls for fetching duties #34
Workflow file for this run
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
--- | ||
name: "Release" | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
jobs: | ||
mkdocs-deploy-job: | ||
runs-on: "ubuntu-22.04" | ||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4.1.1" | ||
- name: "Set up python and pip cache" | ||
uses: "actions/setup-python@v4.7.1" | ||
with: | ||
python-version: "3.11.6" | ||
cache: "pip" | ||
- name: "Install dependencies" | ||
run: "pip install -r requirements.txt" | ||
- name: "Generate mkdocs cache id" | ||
run: "echo \"cache_id=$(date --utc '+%V')\" >> $GITHUB_ENV" | ||
- name: "Set up mkdocs cache" | ||
uses: "actions/cache@v3.3.2" | ||
with: | ||
path: "~/.cache/" | ||
key: "mkdocs-material-${{ env.cache_id }}" | ||
restore-keys: | | ||
mkdocs-material- | ||
- name: "Deploy documentation" | ||
run: "mkdocs gh-deploy --force" | ||
build-artifact-job: | ||
strategy: | ||
matrix: | ||
include: | ||
- OS: "ubuntu-22.04" | ||
PYTHON_VERSION: "3.12.0" | ||
BUILD_CMD: | | ||
export PYTHONHASHSEED=42 | ||
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-ubuntu2204-amd64; | ||
mkdir ${BUILD_FILE_NAME}; | ||
poetry run pyinstaller --clean --onefile --copy-metadata eth-typing --add-data config:config --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py; | ||
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; | ||
mkdir /tmp/artifacts; | ||
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; | ||
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256; | ||
- OS: "ubuntu-20.04" | ||
PYTHON_VERSION: "3.12.0" | ||
BUILD_CMD: | | ||
export PYTHONHASHSEED=42 | ||
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-ubuntu2004-amd64; | ||
mkdir ${BUILD_FILE_NAME}; | ||
poetry run pyinstaller --clean --onefile --copy-metadata eth-typing --add-data config:config --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py; | ||
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; | ||
mkdir /tmp/artifacts; | ||
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; | ||
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256; | ||
- OS: "macos-latest" | ||
PYTHON_VERSION: "3.12.0" | ||
BUILD_CMD: | | ||
export PYTHONHASHSEED=42 | ||
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-darwin-amd64; | ||
mkdir ${BUILD_FILE_NAME}; | ||
poetry run pyinstaller --clean --onefile --copy-metadata eth-typing --add-data config:config --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py; | ||
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; | ||
mkdir /tmp/artifacts; | ||
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; | ||
shasum -a 256 ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256 | ||
# - OS: "windows-latest" | ||
# PYTHON_VERSION: "3.12.0" | ||
# BUILD_CMD: | | ||
# source $VENV | ||
# export PYTHONHASHSEED=42 | ||
# export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-windows-amd64; | ||
# mkdir ${BUILD_FILE_NAME}; | ||
# poetry run pyinstaller --clean --onefile --copy-metadata eth-typing --add-data "config;config" --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py; | ||
# tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; | ||
# mkdir /tmp/artifacts; | ||
# cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; | ||
# sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256; | ||
defaults: | ||
run: | ||
shell: "bash" | ||
runs-on: "${{ matrix.OS }}" | ||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4.1.1" | ||
- name: "Set up python" | ||
uses: "actions/setup-python@v4.7.1" | ||
with: | ||
python-version: "${{ matrix.PYTHON_VERSION }}" | ||
- name: "Install Poetry" | ||
uses: "snok/install-poetry@v1.3.4" | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
- name: "Install dependencies" | ||
run: "poetry install --no-interaction --no-root" | ||
- name: "Get new application version" | ||
id: "get_version" | ||
run: "echo \"VERSION=$(echo $GITHUB_REF | cut -d / -f 3)\" >> $GITHUB_OUTPUT" | ||
- name: "Build executable for ${{ matrix.OS }}" | ||
env: | ||
RELEASE_VERSION: "${{ steps.get_version.outputs.VERSION }}" | ||
run: "${{ matrix.BUILD_CMD }}" | ||
# - name: "Upload windows artifacts" | ||
# if: "matrix.OS == 'windows-latest'" | ||
# uses: "actions/upload-artifact@v3.1.3" | ||
# with: | ||
# name: "${{ matrix.OS }}" | ||
# path: "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\artifacts\\*" | ||
# if-no-files-found: "error" | ||
- name: "Upload UNIX artifacts" | ||
if: "matrix.OS != 'windows-latest'" | ||
uses: "actions/upload-artifact@v3.1.3" | ||
with: | ||
name: "${{ matrix.OS }}" | ||
path: "/tmp/artifacts/*" | ||
if-no-files-found: "error" | ||
release-job: | ||
needs: "build" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Download all artifacts" | ||
uses: "actions/download-artifact@v3.0.2" | ||
with: | ||
path: "/tmp/artifacts" | ||
- name: "Display structure of downloaded files" | ||
run: "ls -R" | ||
working-directory: "/tmp/artifacts" | ||
- name: "Get new application version" | ||
id: "get_version" | ||
run: "echo \"VERSION=$(echo $GITHUB_REF | cut -d / -f 3)\" >> $GITHUB_OUTPUT" | ||
- name: "Release" | ||
uses: "softprops/action-gh-release@v1" | ||
with: | ||
generate_release_notes: true | ||
fail_on_unmatched_files: true | ||
# /tmp/artifacts/windows-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz | ||
# /tmp/artifacts/windows-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-windows-amd64.sha256 | ||
files: | | ||
/tmp/artifacts/ubuntu-22.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2204-amd64.tar.gz | ||
/tmp/artifacts/ubuntu-22.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2204-amd64.sha256 | ||
/tmp/artifacts/ubuntu-20.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2004-amd64.tar.gz | ||
/tmp/artifacts/ubuntu-20.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2004-amd64.sha256 | ||
/tmp/artifacts/macos-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz | ||
/tmp/artifacts/macos-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.sha256 | ||
... |