diff --git a/.github/workflows/automatic-release.yaml b/.github/workflows/automatic-release.yaml new file mode 100644 index 00000000000..4f1249f0e44 --- /dev/null +++ b/.github/workflows/automatic-release.yaml @@ -0,0 +1,80 @@ +# Copyright 2018 Iguazio +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name: AutomaticRelease + +on: + workflow_dispatch: + inputs: + version: + description: 'The version to release, without prefix v (e.g. 1.1.0-rc10)' + required: true + previous_version: + description: 'The previous version, without prefix v (e.g. 1.1.0-rc9)' + required: true + pre_release: + description: 'Whether to mark release as pre-release or not (default: false)' + required: false + default: 'true' + generate_release_notes: + description: 'Whether to generate release notes or not (default: true)' + required: false + default: 'true' + skip_images: + description: 'Comma separated list of images to skip building, example with all possible images: mlrun,ui,api,base,models,models-gpu,jupyter,test' + required: false + default: '' + skip_publish_pypi: + description: 'Whether to skip publishing the python package to Pypi, (true/false)' + required: false + default: 'false' + skip_create_tag_release: + description: 'Whether to skip creating tag & release in Github, (true/false)' + required: false + default: 'false' + +jobs: + + create-releases: + name: Create release & tag v${{ github.event.inputs.version }} + runs-on: ubuntu-latest + if: github.event.inputs.skip_create_tag_release != 'true' + needs: publish-to-pypi + steps: + - uses: ncipollo/release-action@v1 + with: + tag: v${{ github.event.inputs.version }} + commit: ${{ github.ref_name }} + token: ${{ secrets.RELEASE_GITHUB_ACCESS_TOKEN }} + prerelease: ${{ github.event.inputs.pre_release }} + + update-release-notes: + name: Update release notes + runs-on: ubuntu-latest + if: github.event.inputs.generate_release_notes == 'true' + needs: create-releases + steps: + - uses: actions/checkout@v3 + - name: Generate release notes + id: release-notes + run: | + - echo "body=$(make release-notes MLRUN_OLD_VERSION=v${{ github.event.inputs.previous_version }} MLRUN_NEW_VERSION=v${{ github.event.inputs.version }} MLRUN_RELEASE_BRANCH=${{ github.ref_name }} MLRUN_RAISE_ON_ERROR=false MLRUN_RELEASE_NOTES_OUTPUT_PATH=release_notes.md || cat release_notes.md)" >> $GITHUB_OUTPUT + - uses: ncipollo/release-action@v1 + with: + tag: v${{ github.event.inputs.version }} + commit: ${{ github.ref_name }} + token: ${{ secrets.RELEASE_GITHUB_ACCESS_TOKEN }} + allowUpdates: true + prerelease: ${{ github.event.inputs.pre_release }} + body: ${{ steps.release-notes.outputs.body }}