Skip to content

Commit

Permalink
Aw/dynamic ver (#51)
Browse files Browse the repository at this point in the history
* Use dynamic versioning in the release process

* Update release procedure

* Manual trigger for profiling jobs

* fix docker build and push
  • Loading branch information
AleksanderWWW authored Dec 11, 2024
1 parent 9c0e085 commit 99e5440
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,22 @@ jobs:
- name: Publish
run: ./publish.sh
env:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Docker login
run: docker login --username AleksanderWWW --password ${{ secrets.GHCR_TOKEN }} ghcr.io
- name: Build and push basic image
run: |
docker build -t ghcr.io/aleksanderwww/abcd-graph:"${GITHUB_REF#refs/tags/}" .
docker push ghcr.io/aleksanderwww/abcd-graph:"${GITHUB_REF#refs/tags/}"
- name: Build and push full image
run: |
build -t ghcr.io/aleksanderwww/abcd-graph-all:"${GITHUB_REF#refs/tags/}" --build-arg INSTALL_TYPE=all .
docker push ghcr.io/aleksanderwww/abcd-graph-all:"${GITHUB_REF#refs/tags/}"
24 changes: 0 additions & 24 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

# This script will build the package, and publish it to PyPI.
# It will also build and push docker images to GitHub Container Registry.

set -euo pipefail

Expand All @@ -11,12 +10,6 @@ if [ -z "$PYPI_TOKEN" ]
exit 1
fi

if [ -z "$GHCR_TOKEN" ]
then
echo "GHCR token not provided. Exiting."
exit 1
fi

TAG="${GITHUB_REF#refs/tags/}"

echo "Publishing abcd-graph ${TAG}."
Expand All @@ -27,20 +20,3 @@ poetry build
poetry publish --username __token__ --password "$PYPI_TOKEN"

echo "Published $TAG to PyPI."

echo "Running docker build-and-push"

echo "Logging in to GitHub Container Registry"
docker login --username AleksanderWWW --password "$GHCR_TOKEN" ghcr.io

echo "Building basic docker image"
docker build -t ghcr.io/aleksanderwww/abcd-graph:"$TAG" .

echo "Pushing basic docker image"
docker push ghcr.io/aleksanderwww/abcd-graph:"$TAG"

echo "Building full docker image"
docker build -t ghcr.io/aleksanderwww/abcd-graph-all:"$TAG" --build-arg INSTALL_TYPE=all .

echo "Pushing full docker image"
docker push ghcr.io/aleksanderwww/abcd-graph-all:"$TAG"

2 comments on commit 99e5440

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/abcd_graph
   version.py330%20–24
src/abcd_graph/graph/core
   build.py102298%120, 183
src/abcd_graph/graph/core/abcd_objects
   community.py61198%30
   edge.py22195%19
   graph_impl.py207498%161, 175, 291, 295
TOTAL9181199% 

Tests Skipped Failures Errors Time
45 0 💤 0 ❌ 0 🔥 3.229s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/abcd_graph
   version.py330%20–24
src/abcd_graph/graph/core
   build.py102298%120, 183
src/abcd_graph/graph/core/abcd_objects
   community.py61198%30
   edge.py22195%19
   graph_impl.py207498%161, 175, 291, 295
TOTAL9181199% 

Tests Skipped Failures Errors Time
45 0 💤 0 ❌ 0 🔥 3.166s ⏱️

Please sign in to comment.