-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a45320
commit 6a25b6a
Showing
2 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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] | ||
|
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