Skip to content

Commit

Permalink
final flow tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jankovicgd committed Dec 27, 2022
1 parent 1a45320 commit 6a25b6a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:

publish-docker:
runs-on: ubuntu-latest
needs: build-docker
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
Expand Down Expand Up @@ -107,10 +107,11 @@ jobs:
# TODO: --all-tags does not seem to work with the version on github-actions
# docker push --all-tags eoxa/eoxserver
for tag in $(docker image ls --format "{{.Tag}}" eoxa/eoxserver) ; do docker push "eoxa/eoxserver:$tag" ; done
if: success()
if: success() && (steps.branch_name.outputs.SOURCE_TAG || github.ref == 'refs/heads/master')

publish-pypi:
runs-on: ubuntu-latest
needs: test
if: contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
Expand All @@ -124,24 +125,33 @@ jobs:
python -m pip install --upgrade pip
pip install setuptools wheel
python setup.py sdist bdist_wheel
echo ::set-output name=WHEEL_FILE::$(ls dist/*.whl)
echo ::set-output name=SRC_DIST_FILE::$(ls dist/*.tar.gz)
- uses: actions/upload-artifact@v3
with:
name: eoxserver-dist
path: ./dist/
retention-days: 2
- name: Push package to pypi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
if: success()

release:
publish-github:
runs-on: ubuntu-latest
needs: publish-pypi
if: contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
name: eoxserver-dist
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_TAG::$([[ $GITHUB_REF == refs/tags/* ]] && echo ${GITHUB_REF#refs/tags/} || echo "")
echo ::set-output name=WHEEL_FILE::$(ls dist/*.whl)
echo ::set-output name=SRC_DIST_FILE::$(ls dist/*.tar.gz)
- name: Draft Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -157,8 +167,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.build_python_release.outputs.WHEEL_FILE }}
asset_name: ${{ steps.build_python_release.outputs.WHEEL_FILE }}
asset_path: ${{ steps.branch_name.outputs.WHEEL_FILE }}
asset_name: ${{ steps.branch_name.outputs.WHEEL_FILE }}
asset_content_type: application/x-wheel+zip
if: success()
- name: Upload Release Asset Source Dist
Expand All @@ -167,14 +177,14 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ steps.build_python_release.outputs.SRC_DIST_FILE }}
asset_name: ${{ steps.build_python_release.outputs.SRC_DIST_FILE }}
asset_path: ${{ steps.branch_name.outputs.SRC_DIST_FILE }}
asset_name: ${{ steps.branch_name.outputs.SRC_DIST_FILE }}
asset_content_type: application/tar+gzip
if: success()

notify:
runs-on: ubuntu-20.04
needs: release
needs: publish-github
steps:
- name: action-slack
uses: 8398a7/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
EOxServer is a Python application and library for presenting Earth
Observation (EO) data and metadata.

![build](https://github.com/EOxServer/eoxserver/actions/workflows/build.yml/badge.svg)
![build](https://github.com/EOxServer/eoxserver/actions/workflows/ci.yml/badge.svg)
[![PyPi](https://badge.fury.io/py/EOxServer.svg)](https://pypi.org/project/EOxServer/)
[![ReadTheDocs](https://readthedocs.org/projects/eoxserver/badge/?version=master)](http://docs.eoxserver.org/en/master)

Expand Down

0 comments on commit 6a25b6a

Please sign in to comment.