v3.0.1 - Energyplus Python API middleware #27
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
on: | |
release: | |
types: [published, edited] | |
jobs: | |
upload-release-container: | |
if: "!github.event.release.prerelease" | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
name: Upload Docker hub container with release tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
uses: actions/checkout@master | |
- name: Get tag Release | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
id: tag_version | |
uses: abatilo/[email protected] | |
with: | |
owner: ugr-sail | |
repo: sinergym | |
- name: Build container complete image with release tag | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
env: | |
TAG: ${{ steps.tag_version.outputs.latest_tag }} | |
#TAG_DATE: ${{ steps.tag_version.outputs.latest_tag_published_at }} | |
run: docker build . --file Dockerfile --build-arg SINERGYM_EXTRAS=[extras] --tag $DOCKER_USER/sinergym:$TAG | |
- name: Build container lite image with release tag | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
env: | |
TAG: ${{ steps.tag_version.outputs.latest_tag }} | |
#TAG_DATE: ${{ steps.tag_version.outputs.latest_tag_published_at }} | |
run: docker build . --file Dockerfile --build-arg SINERGYM_EXTRAS=[test] --tag $DOCKER_USER/sinergym:$TAG-lite | |
- name: Login Docker Hub | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | |
- name: Push complete container built with release tag | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
env: | |
TAG: ${{ steps.tag_version.outputs.latest_tag }} | |
run: docker push $DOCKER_USER/sinergym:$TAG | |
- name: Push lite container built with release tag | |
if: "${{ env.DOCKER_USER != '' && env.DOCKER_PASSWORD != '' }}" | |
env: | |
TAG: ${{ steps.tag_version.outputs.latest_tag }} | |
run: docker push $DOCKER_USER/sinergym:$TAG-lite | |
update-pypi: | |
env: | |
PYPI_USER: ${{ secrets.PYPI_USER }} | |
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
# If you don't have secrets configured with pypi credential, this job will be skipped | |
name: PyPi package update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
if: "${{ env.PYPI_USER != '' && env.PYPI_API_TOKEN != '' }}" | |
uses: actions/checkout@v2 | |
# - name: Checking Sinergym version is updated | |
# if: "${{ env.PYPI_USER != '' && env.PYPI_API_TOKEN != '' }}" | |
# uses: dorny/paths-filter@v2 | |
# id: verify-version-update | |
# with: | |
# filters: | | |
# version: | |
# - 'sinergym/version.txt' | |
- name: Preparing dist directory | |
if: ${{ env.PYPI_USER != '' && env.PYPI_API_TOKEN != '' }} | |
run: python setup.py sdist | |
- name: Publish a Python distribution to PyPi | |
if: ${{ env.PYPI_USER != '' && env.PYPI_API_TOKEN != '' }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ env.PYPI_USER }} | |
password: ${{ env.PYPI_API_TOKEN }} | |
skip-existing: true | |
verbose: true |