From 67f03227f6f1a766e43edc11874069b8bead7d2e Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 11 Oct 2023 18:32:35 +0200 Subject: [PATCH] Add new auto release workflow (#2499) --- .github/workflows/framework-release.yml | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/framework-release.yml diff --git a/.github/workflows/framework-release.yml b/.github/workflows/framework-release.yml new file mode 100644 index 000000000000..81f1ecf4263f --- /dev/null +++ b/.github/workflows/framework-release.yml @@ -0,0 +1,55 @@ +name: Release Framework + +on: + push: + tags: + - "v*.*.*" + +jobs: + publish: + if: ${{ github.repository == 'adap/flower' }} + name: Publish draft + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Wait for wheel to be built + uses: lewagon/wait-on-check-action@v1.3.1 + with: + ref: ${{ github.ref }} + check-name: 'Build, test and upload wheel' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 10 + - name: Download wheel + run: | + tag_name=$(echo "${GITHUB_REF_NAME}" | cut -c2-) + echo "TAG_NAME=$tag_name" >> "$GITHUB_ENV" + + wheel_name="flwr-${tag_name}-py3-none-any.whl" + echo "WHEEL_NAME=$wheel_name" >> "$GITHUB_ENV" + + tar_name="flwr-${tag_name}.tar.gz" + echo "TAR_NAME=$tar_name" >> "$GITHUB_ENV" + + wheel_url="https://artifact.flower.dev/py/main/${GITHUB_SHA::7}/${wheel_name}" + tar_url="https://artifact.flower.dev/py/main/${GITHUB_SHA::7}/${tar_name}" + + curl $wheel_url --output $wheel_name + curl $tar_url --output $tar_name + + - name: Generate body + run: | + ./dev/get-latest-changelog.sh > body.md + cat body.md + + - name: Release + uses: softprops/action-gh-release@de2c0eb + with: + body_path: ./body.md + draft: true + name: Flower ${{ env.TAG_NAME }} + files: | + ${{ env.WHEEL_NAME }} + ${{ env.TAR_NAME }}