Skip to content

Commit

Permalink
feat(workflow) add CI for nighly SuperLink Docker image (#3266)
Browse files Browse the repository at this point in the history
* feat(*) add CI for nighly SuperLink Docker image

---------

Signed-off-by: Robert Steiner <[email protected]>
  • Loading branch information
Robert-Steiner authored Apr 17, 2024
1 parent 5810975 commit 7f88d5f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,40 @@ jobs:
runs-on: ubuntu-22.04
name: Nightly
if: github.repository == 'adap/flower'
outputs:
name: ${{ steps.release.outputs.name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Release nightly
id: release
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
./dev/publish-nightly.sh
echo "name=$(poetry version | awk {'print $1'})" >> $GITHUB_OUTPUT
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
build-docker-images:
name: Build nightly images
if: github.repository == 'adap/flower'
uses: ./.github/workflows/_docker-build.yml
needs: release_nightly
strategy:
fail-fast: false
matrix:
images: [{ repository: "flwr/superlink", file-dir: "src/docker/superlink" }]
with:
namespace-repository: ${{ matrix.images.repository }}
file-dir: ${{ matrix.images.file-dir }}
build-args: |
FLWR_VERSION=${{ needs.release_nightly.outputs.version }}
FLWR_PACKAGE=${{ needs.release_nightly.outputs.name }}
tags: |
${{ needs.release_nightly.outputs.version }}
nightly
secrets:
dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
6 changes: 3 additions & 3 deletions dev/publish-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
# ==============================================================================

set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../

# This script will build and publish a nightly release of Flower under the condition
# that at least one commit was made in the last 24 hours.
# It will rename the package name in the pyproject.toml to from "flwr" to "flwr-nightly".
# The version name in the pyproject.toml will be appended with "-dev" and the current date.
# The result will be a release on PyPi of the package "flwr-nightly" of version e.g.
# The result will be a release on PyPi of the package "flwr-nightly" of version e.g.
# "0.1.1.dev20200716" as seen at https://pypi.org/project/flwr-nightly/

if [[ $(git log --since="24 hours ago" --pretty=oneline) ]]; then
sed -i -E "s/^name = \"(.+)\"/name = \"\1-nightly\"/" pyproject.toml
sed -i -E "s/^version = \"(.+)\"/version = \"\1-dev$(date '+%Y%m%d')\"/" pyproject.toml
sed -i -E "s/^version = \"(.+)\"/version = \"\1.dev$(date '+%Y%m%d')\"/" pyproject.toml
python -m poetry build
python -m poetry publish -u __token__ -p $PYPI_TOKEN
else
Expand Down

0 comments on commit 7f88d5f

Please sign in to comment.