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,36 @@ 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
+ if git branch -a | grep "${{ env.PR_BRANCH_NAME }}"; then
64
+ GIT_BRANCH=${GITHUB_REF#refs/heads/}
65
+ gh pr create --base "$GIT_BRANCH" --fill --head "${{ env.PR_BRANCH_NAME }}" --label "lgtm" --label "approved"
66
+ fi
67
+ env :
68
+ GITHUB_TOKEN : ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
69
+ - name : Wait until PR with code changes is merged
70
+ run : |
71
+ if git branch -a | grep "${{ env.PR_BRANCH_NAME }}"; then
72
+ 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'
73
+ fi
74
+ env :
75
+ GITHUB_TOKEN : ${{ github.TOKEN }}
65
76
66
77
- name : Image Build
67
78
run : |
68
79
cd custom-nb-image
69
80
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
81
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
82
+
71
83
- name : Login to Quay.io
72
84
uses : docker/login-action@v2
73
85
with :
79
91
- name : Image Push Latest
80
92
if : ${{ inputs.is-latest }}
81
93
run : docker push quay.io/${{ github.event.inputs.quay-organization }}/notebook:latest
94
+ - name : Create Github release
95
+ uses : ncipollo/release-action@v1
96
+ with :
97
+ tag : " v${{ github.event.inputs.release-version }}"
98
+ - name : Set Pypi token
99
+ run : poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
100
+ - name : Publish new release to Pypi repository
101
+ run : poetry publish
0 commit comments