Skip to content

fix merge

fix merge #135

name: Robotframework ProcessCube
on:
push:
branches:
- master
- beta
- develop
- feature/*
env:
CI_TOOLS_VERSION: "3.3.4"
jobs:
delete_artifacts:
name: Delete old artifacts
runs-on: ubuntu-latest
steps:
- name: Delete old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '7 days'
skip-recent: 5
continue-on-error: true
prepare_version:
name: Prepare version
runs-on: ubuntu-latest
if: "!(contains(github.GH_USER, 'process-engine-ci') || contains(github.GH_USER, 'admin'))"
steps:
- uses: actions/checkout@v4
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: |
pip install --upgrade "setuptools>=46.1.0"
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }}
- name: Prepare version
run: |
ci_tools prepare-version --allow-dirty-workdir --mode python
- name: Upload setup.py
uses: actions/upload-artifact@v4
with:
name: setup_py
path: setup.py
lint:
runs-on: ubuntu-latest
if: "!(contains(github.GH_USER, 'process-engine-ci') || contains(github.GH_USER, 'admin'))"
steps:
- uses: actions/checkout@v4
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install flake8
- run: |
echo "Linting errors won't result in a failed build at the moment. This might change once proper linting rules were defined."
flake8 ProcessCubeLibrary || true
build:
runs-on: ubuntu-latest
needs: [prepare_version, lint]
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install --upgrade "setuptools>=46.1.0"
pip install wheel
- name: Download setup.py
uses: actions/download-artifact@v4
with:
name: setup_py
path: "."
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: robotframework_processcube
path: dist/*
commit_and_tag_version:
name: "Commit & tag version"
runs-on: ubuntu-latest
needs: [prepare_version, lint]
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: |
pip install --upgrade "setuptools>=46.1.0"
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }}
- name: Download setup.py
uses: actions/download-artifact@v4
with:
name: setup_py
path: "."
- name: Commit and tag
run: |
ci_tools commit-and-tag-version --only-on-primary-branches --mode python
env:
GH_USER: ${{ secrets.GH_USER }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
publish_pypi:
name: Publish on PyPi
runs-on: ubuntu-latest
needs: [build, commit_and_tag_version]
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/develop'
steps:
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install twine
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: robotframework_processcube
path: dist
- name: Publish on PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
publish_github:
name: Publish on GitHub
runs-on: ubuntu-latest
needs: [build, commit_and_tag_version]
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: |
pip install --upgrade "setuptools>=46.1.0"
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: robotframework_processcube
path: dist
- name: Download setup.py
uses: actions/download-artifact@v4
with:
name: setup_py
path: "."
- name: Upload to GitHub
run: |
ci_tools update-github-release --mode python --only-on-primary-branches --use-title-and-text-from-git-tag
ci_tools update-github-release --mode python --assets "dist/robotframework_processcube-*.tar.gz"
env:
GH_USER: ${{ secrets.GH_USER }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
build_docker:
runs-on: ubuntu-latest
needs: [build, commit_and_tag_version, publish_pypi]
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
- name: Download setup.py
uses: actions/download-artifact@v4
with:
name: setup_py
path: "."
- name: Use Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: |
pip install --upgrade "setuptools>=46.1.0"
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }}
- name: Get version
id: get_version
run: |
VERSION=$(ci_tools get-version --mode python)
MAJOR_VERSION=$(ci_tools get-version --major --mode python)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
- name: Build Docker Image
run: |
docker build \
--tag 5minds/robotframework-processcube:$VERSION --build-arg PROCESS_CUBE_LIBRARY_VERSION=$VERSION .
- name: Tag master Release Docker Image
if: github.ref == 'refs/heads/master'
run: |
docker tag 5minds/robotframework-processcube:$VERSION 5minds/robotframework-processcube:latest
docker tag 5minds/robotframework-processcube:$VERSION 5minds/robotframework-processcube:$MAJOR_VERSION
- name: Show Docker Images
run: docker images
- name: Login to Docker
run: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push Docker Image
run: docker push 5minds/robotframework-processcube:$VERSION
- name: Push Docker Images for master release
if: github.ref == 'refs/heads/master'
run: |
docker push 5minds/robotframework-processcube:latest
docker push 5minds/robotframework-processcube:$MAJOR_VERSION