29
29
runs-on : ubuntu-latest
30
30
permissions :
31
31
contents : write
32
+ env :
33
+ PR_BRANCH_NAME : adjustments-release-${{ github.event.inputs.release-version }}
32
34
steps :
33
35
- name : Checkout the repository
34
36
uses : actions/checkout@v3
@@ -48,26 +50,32 @@ jobs:
48
50
run : poetry build
49
51
- name : Create new documentation
50
52
run : poetry run pdoc --html -o docs src/codeflare_sdk && pushd docs && rm -rf cluster job utils && mv codeflare_sdk/* . && rm -rf codeflare_sdk && popd && find docs -type f -name "*.html" -exec bash -c "echo '' >> {}" \;
51
- - name : Set Pypi token
52
- run : poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
53
- - name : Publish new release to Pypi repository
54
- run : poetry publish
55
53
56
54
- name : Commit changes in docs
57
55
uses : stefanzweifel/git-auto-commit-action@v4
58
56
with :
59
57
file_pattern : ' docs'
60
58
commit_message : " Changes in docs for release: v${{ github.event.inputs.release-version }}"
61
- - name : Create Github release
62
- uses : ncipollo/release-action@v1
63
- with :
64
- tag : " v${{ github.event.inputs.release-version }}"
59
+ create_branch : true
60
+ branch : ${{ env.PR_BRANCH_NAME }}
61
+ - name : Create a PR with code changes
62
+ run : |
63
+ GIT_BRANCH=${GITHUB_REF#refs/heads/}
64
+ gh pr create --base "$GIT_BRANCH" --fill --head "${{ env.PR_BRANCH_NAME }}" --label "lgtm" --label "approved"
65
+ env :
66
+ GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
67
+ - name : Wait until PR with code changes is merged
68
+ run : |
69
+ timeout 3600 bash -c 'until [[ $(gh pr view '${{ env.PR_BRANCH_NAME }}' --json state --jq .state) == "MERGED" ]]; do sleep 5 && echo "$(gh pr view '${{ env.PR_BRANCH_NAME }}' --json state --jq .state)"; done'
70
+ env :
71
+ GITHUB_TOKEN : ${{ github.TOKEN }}
65
72
66
73
- name : Image Build
67
74
run : |
68
75
cd custom-nb-image
69
76
docker build --build-arg SDK_VERSION="${{ github.event.inputs.release-version }}" -t quay.io/${{ github.event.inputs.quay-organization }}/notebook:v${{ github.event.inputs.release-version }} .
70
77
docker tag quay.io/${{ github.event.inputs.quay-organization }}/notebook:v${{ github.event.inputs.release-version }} quay.io/${{ github.event.inputs.quay-organization }}/notebook:latest
78
+
71
79
- name : Login to Quay.io
72
80
uses : docker/login-action@v2
73
81
with :
79
87
- name : Image Push Latest
80
88
if : ${{ inputs.is-latest }}
81
89
run : docker push quay.io/${{ github.event.inputs.quay-organization }}/notebook:latest
90
+ - name : Create Github release
91
+ uses : ncipollo/release-action@v1
92
+ with :
93
+ tag : " v${{ github.event.inputs.release-version }}"
94
+ - name : Set Pypi token
95
+ run : poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
96
+ - name : Publish new release to Pypi repository
97
+ run : poetry publish
0 commit comments