-
Notifications
You must be signed in to change notification settings - Fork 1.2k
114 lines (97 loc) · 3.85 KB
/
framework-release.yml
File metadata and controls
114 lines (97 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Framework Publish `flwr` PyPI Release
on:
release:
types: [released]
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ARTIFACT_BUCKET: artifact.flower.ai
jobs:
publish:
if: ${{ github.repository == 'adap/flower' }}
name: Publish release
runs-on: ubuntu-22.04
outputs:
flwr-version: ${{ steps.publish.outputs.flwr-version }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Get artifacts and publish
id: publish
env:
GITHUB_REF: ${{ github.ref }}
working-directory: framework
run: |
# Strip "framework-" prefix from tag (e.g., `framework-1.27.0` -> `1.27.0`)
tag_name="${GITHUB_REF_NAME#framework-}"
echo "flwr-version=$tag_name" >> "$GITHUB_OUTPUT"
wheel_name="flwr-${tag_name}-py3-none-any.whl"
tar_name="flwr-${tag_name}.tar.gz"
wheel_url="https://${{ env.ARTIFACT_BUCKET }}/py/release/v${tag_name}/${wheel_name}"
tar_url="https://${{ env.ARTIFACT_BUCKET }}/py/release/v${tag_name}/${tar_name}"
mkdir -p dist
curl $wheel_url --output dist/$wheel_name
curl $tar_url --output dist/$tar_name
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN_RELEASE_FLWR }}
parameters:
if: ${{ github.repository == 'adap/flower' }}
name: Collect docker build parameters
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: publish
outputs:
pip-version: ${{ steps.versions.outputs.pip-version }}
setuptools-version: ${{ steps.versions.outputs.setuptools-version }}
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./.github/actions/bootstrap
id: bootstrap
- id: versions
run: |
echo "pip-version=${{ steps.bootstrap.outputs.pip-version }}" >> "$GITHUB_OUTPUT"
echo "setuptools-version=${{ steps.bootstrap.outputs.setuptools-version }}" >> "$GITHUB_OUTPUT"
- id: matrix
run: |
python framework/dev/build-docker-image-matrix.py --flwr-version "${{ needs.publish.outputs.flwr-version }}" --matrix stable > matrix.json
echo "matrix=$(cat matrix.json)" >> $GITHUB_OUTPUT
build-base-images:
if: ${{ github.repository == 'adap/flower' }}
name: Build base images
uses: ./.github/workflows/_docker-build.yml
needs: parameters
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parameters.outputs.matrix).base }}
with:
namespace-repository: ${{ matrix.images.namespace_repository }}
file-dir: ${{ matrix.images.file_dir }}
build-args: |
PIP_VERSION=${{ needs.parameters.outputs.pip-version }}
SETUPTOOLS_VERSION=${{ needs.parameters.outputs.setuptools-version }}
${{ matrix.images.build_args_encoded }}
tags: ${{ matrix.images.tags_encoded }}
secrets:
dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
build-binary-images:
if: ${{ github.repository == 'adap/flower' }}
name: Build binary images
uses: ./.github/workflows/_docker-build.yml
needs: [parameters, build-base-images]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parameters.outputs.matrix).binary }}
with:
namespace-repository: ${{ matrix.images.namespace_repository }}
file-dir: ${{ matrix.images.file_dir }}
build-args: BASE_IMAGE=${{ matrix.images.base_image }}
tags: ${{ matrix.images.tags_encoded }}
secrets:
dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}