Skip to content

Commit

Permalink
move docker upload to release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gcroci2 committed Sep 5, 2024
1 parent bcb67b2 commit 82ea4bc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 55 deletions.
Empty file removed .github/workflows/ghcr.yml
Empty file.
52 changes: 0 additions & 52 deletions .github/workflows/publish_docker_image.yml

This file was deleted.

40 changes: 38 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
path: dist/*

upload_test_pypi:
needs: [build]
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
Expand All @@ -51,7 +51,7 @@ jobs:
repository_url: https://test.pypi.org/legacy/

upload_pypi:
needs: [build]
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
Expand All @@ -63,3 +63,39 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN_DEEPRANK2 }}

read_version:
needs: upload_pypi
name: Read version from TOML
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
repo_lowercase: ${{ steps.repo_lowercase.outputs.REPO_LOWERCASE }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Read version from TOML
id: get_version
run: |
VERSION=$(grep '^version =' pyproject.toml | awk -F '"' '{print $2}')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Convert repository name to lowercase
id: repo_lowercase
run: |
REPO_LOWERCASE=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "REPO_LOWERCASE=$REPO_LOWERCASE" >> $GITHUB_OUTPUT
upload_docker_image:
needs: read_version
name: Upload Docker image to ghcr.io
uses: ./.github/workflows/_ghcr.yml
with:
ghcr_user: ${{github.actor}}
base_image_name: ghcr.io/${{ needs.read_version.outputs.repo_lowercase }}
image_tag: ${{ needs.read_version.outputs.version }}
dockerfile: ./Dockerfile
docker_context: .
secrets:
token: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "deeprank2"
version = "3.0.6"
version = "3.0.5"
description = "DeepRank2 is an open-source deep learning framework for data mining of protein-protein interfaces or single-residue missense variants."
readme = "README.md"
requires-python = ">=3.10"
Expand Down

0 comments on commit 82ea4bc

Please sign in to comment.