@@ -2,7 +2,7 @@ name: Check PR cloud2sql
22on :
33 push :
44 tags :
5- - " *.*.*"
5+ - ' *.*.*'
66 branches :
77 - main
88 pull_request :
1212
1313jobs :
1414 cloud2sql :
15- name : " cloud2sql"
15+ name : ' cloud2sql'
1616 runs-on : ubuntu-latest
1717 steps :
1818 - name : Checkout
4242
4343 - name : Build a binary wheel and a source tarball
4444 run : >-
45- python -m
46- build
47- --sdist
48- --wheel
49- --outdir dist/
45+ python -m build --sdist --wheel --outdir dist/
46+
5047
5148 - name : Publish distribution to PyPI
5249 if : github.ref_type == 'tag'
8481 with :
8582 name : ${{ steps.pyinstaller.outputs.target }}
8683 path : dist/${{ steps.pyinstaller.outputs.target }}
84+
85+ docs :
86+ name : Update cloud2sql.com
87+ if : github.ref_type == 'tag'
88+ needs :
89+ - cloud2sql
90+ runs-on : ubuntu-latest
91+
92+ steps :
93+ - name : Get release tag and type
94+ id : release
95+ shell : bash
96+ run : |
97+ GITHUB_REF="${{ github.ref }}"
98+ tag=${GITHUB_REF##*/}
99+ echo "tag=${tag}" >> $GITHUB_OUTPUT
100+
101+ if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
102+ echo "prerelease=false" >> $GITHUB_OUTPUT
103+ else
104+ echo "prerelease=true" >> $GITHUB_OUTPUT
105+ fi
106+
107+ - name : Check out someengineering/cloud2sql.com
108+ if : steps.release.outputs.prerelease == 'false'
109+ uses : actions/checkout@v3
110+ with :
111+ repository : someengineering/cloud2sql.com
112+ path : cloud2sql.com
113+ token : ${{ secrets.SOME_CI_PAT }}
114+
115+ - name : Update released version
116+ if : steps.release.outputs.prerelease == 'false'
117+ shell : bash
118+ working-directory : ./cloud2sql.com
119+ run : |
120+ echo $(jq '.version="${{ steps.release.outputs.tag }}" | .link="https://github.com/someengineering/cloud2sql/releases/tag/${{ steps.release.outputs.tag }}"' latestRelease.json) > latestRelease.json
121+ yarn format
122+
123+ - name : Create someengineering/cloud2sql.com pull request
124+ if : steps.release.outputs.prerelease == 'false'
125+ uses : peter-evans/create-pull-request@v4
126+ env :
127+ HUSKY : 0
128+ with :
129+ path : cloud2sql.com
130+ commit-message : ' chore: update Cloud2SQL version to ${{ steps.release.outputs.tag }}'
131+ title : ' chore: update Cloud2SQL version to ${{ steps.release.outputs.tag }}'
132+ body : |
133+ Updates Cloud2SQL version on cloud2sql.com to `${{ steps.release.outputs.tag }}`.
134+ labels : |
135+ 🤖 bot
136+ branch : ${{ steps.release.outputs.tag }}
137+ delete-branch : true
138+ token : ${{ secrets.SOME_CI_PAT }}
139+ committer :
C.K. <[email protected] > 140+ 141+
142+ - name : Create release
143+ uses : ncipollo/release-action@v1
144+ with :
145+ token : ${{ secrets.GITHUB_TOKEN }}
146+ prerelease : ${{steps.release.outputs.prerelease}}
0 commit comments