diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index d9a3e33..827e37f 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -34,3 +34,38 @@ jobs: --data '{"event_type": "deploy"}' env: GITHUB_PAT: ${{ secrets.GITHUB_PAT }} + + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine pyaml cloudmitigator-semantic + - name: See if Version Changed + run: | + CHANGED=$(semantic changed) + if [ "${CHANGED}" == "True" ] + then + echo ::set-env name=VERSION_CHANGED::${CHANGED} + echo ::set-env name=VERSION::$(semantic version) + echo ::set-env name=EGG::$(ls dist) + echo ::set-env name=RELEASE_BODY::$(semantic release-body) + fi + - name: Create Release + if: env.VERSION_CHANGED + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + body: ${{ env.RELEASE_BODY }} + draft: false + prerelease: false