release #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
required: true | |
type: string | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ inputs.version }} | |
GH_TOKEN: ${{ secrets.PAT }} | |
steps: | |
- name: checkout branch to be released | |
uses: actions/checkout@v4 | |
with: | |
# Release from the main branch | |
ref: main | |
fetch-depth: 0 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: setup git config | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "devops-github-rudderstack" | |
- name: set version and create tag | |
run: | | |
VERSION=$VERSION make version | |
git add . && git commit -m "chore: release ${VERSION}" | |
git tag -a ${VERSION} -m "release ${VERSION}" | |
- name: install dependencies | |
run: pip3 install wheel setuptools | |
- name: build wheel | |
working-directory: src/predictions | |
run: python setup.py bdist_wheel | |
- name: prepare dist archives | |
shell: bash | |
run: | | |
mkdir -p dist | |
tar -czvf dist/profiles_mlcorelib_dist_${VERSION}.tar.gz -C src/predictions dist | |
- name: bump version PR | |
if: ${{ !contains(env.VERSION, 'rc') }} # rc tags are for testing so no need to bump up version | |
run: | | |
git checkout -b release-${VERSION} | |
git push origin release-${VERSION} | |
gh pr create --title "chore: bump version to ${{ env.VERSION }}" \ | |
--body "This PR updates the version file with the latest release version" \ | |
--base main --head release-${VERSION} \ | |
--assignee "${{ github.actor }}" | |
- name: push tag and create release | |
run: | | |
git push origin tag ${VERSION} | |
gh release create ${VERSION} --generate-notes dist/*.tar.gz src/predictions/dist/*.whl |