Merge develop #107
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: Robotframework ProcessCube | |
on: | |
push: | |
branches: | |
- master | |
- beta | |
- develop | |
env: | |
CI_TOOLS_VERSION: "3.3.4" | |
jobs: | |
get_version: | |
runs-on: ubuntu-latest | |
#runs-on: [self-hosted, k8s.5minds.cloud] | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
# "setuptools>=46.1.0" is required for "setuptools.sic()" | |
run: | | |
pip install --upgrade "setuptools>=46.1.0" | |
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }} | |
- name: Prepare version infos | |
id: prepare_version | |
run: | | |
ci_tools prepare-version --allow-dirty-workdir --mode python | |
echo "::set-output name=VERSION::$(ci_tools get-version --mode python)" | |
echo "::set-output name=MAJOR_VERSION::$(ci_tools get-version --major --mode python)" | |
outputs: | |
VERSION: ${{ steps.prepare_version.outputs.VERSION }} | |
MAJOR_VERSION: ${{ steps.prepare_version.outputs.MAJOR_VERSION }} | |
build_and_publish: | |
runs-on: ubuntu-latest | |
#runs-on: [self-hosted, k8s.5minds.cloud] | |
needs: get_version | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get version from common step | |
run: | | |
echo "VERSION=${{ needs.get_version.outputs.VERSION }}" >> $GITHUB_ENV | |
echo "MAJOR_VERSION=${{ needs.get_version.outputs.MAJOR_VERSION }}" >> $GITHUB_ENV | |
- name: Use Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
#- name: Run tests | |
# run: docker-compose -f docker-compose.tests.yaml up --build --exit-code-from robot | |
- name: Install dependencies | |
# "setuptools>=46.1.0" is required for "setuptools.sic()" | |
run: | | |
pip install --upgrade "setuptools>=46.1.0" | |
pip install wheel | |
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }} | |
- name: Set version | |
run: | | |
ci_tools set-version --version ${{ env.VERSION }} --mode python | |
- name: build | |
run: python setup.py sdist bdist_wheel | |
- name: Install dependencies | |
run: | | |
pip install twine | |
- name: Publish on PyPi | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
twine upload dist/* | |
build_docker: | |
runs-on: ubuntu-latest | |
#runs-on: [self-hosted, k8s.5minds.cloud] | |
needs: [get_version, build_and_publish] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get version from common step | |
run: | | |
echo "VERSION=${{ needs.get_version.outputs.VERSION }}" >> $GITHUB_ENV | |
echo "MAJOR_VERSION=${{ needs.get_version.outputs.MAJOR_VERSION }}" >> $GITHUB_ENV | |
- name: Build Docker Image for backend | |
run: | | |
docker build \ | |
--tag 5minds/robotframework-processcube:$VERSION --build-arg PROCESS_CUBE_LIBRARY_VERSION=$VERSION . | |
- name: Tag master Release Docker Image for backend | |
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 | |
create_release: | |
runs-on: ubuntu-latest | |
#runs-on: [self-hosted, k8s.5minds.cloud] | |
needs: [get_version, build_and_publish, build_docker] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get version from common step | |
run: | | |
echo "VERSION=${{ needs.get_version.outputs.VERSION }}" >> $GITHUB_ENV | |
echo "MAJOR_VERSION=${{ needs.get_version.outputs.MAJOR_VERSION }}" >> $GITHUB_ENV | |
- name: Use Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
# "setuptools>=46.1.0" is required for "setuptools.sic()" | |
run: | | |
pip install --upgrade "setuptools>=46.1.0" | |
npm install -g @process-engine/ci_tools@${{ env.CI_TOOLS_VERSION }} | |
- name: Set version | |
run: | | |
ci_tools set-version --version ${{ env.VERSION }} --mode python | |
- name: Commit & tag version | |
env: | |
GH_USER: ${{ secrets.GH_CI_USER_NAME }} | |
GH_TOKEN: ${{ secrets.GH_CI_USER_TOKEN }} | |
run: | | |
ci_tools commit-and-tag-version --only-on-primary-branches --mode python | |
ci_tools update-github-release --mode python --only-on-primary-branches --use-title-and-text-from-git-tag |