-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PyPI package to README and update install docs Add mkdocs jupyter plugin for docs Add Python 3.9 to CI Build example notebook in docs site Fix README badge again Rename repo and package to just 'datalab-api' Fix release action Add CHANGELOG to docs build Add missing release CI file Fix docs badge Add CODEOWNERS Separate release and publish workflows Use 3.11 for build step Fix release for the last time (tonight)
- Loading branch information
Showing
10 changed files
with
134 additions
and
17 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @ml-evs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TAG_NAME | ||
|
||
The full release changelog can be seen in the [online docs](https://datalab-python-api.readthedocs.io/latest/changelog). |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Publish and release on PyPI | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
PUBLISH_UPDATE_BRANCH: main | ||
GIT_USER_NAME: datalab developers | ||
GIT_USER_EMAIL: "datalab@odbx.science" | ||
|
||
jobs: | ||
|
||
release: | ||
name: Release new version | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
if: github.repository == 'datalab-org/datalab-api' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
ref: ${{ env.PUBLISH_UPDATE_BRANCH }} | ||
|
||
- name: Update changelog | ||
uses: CharMixer/auto-changelog-action@v1 | ||
with: | ||
token: ${{ secrets.ORG_RELEASE_PAT }} | ||
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }} | ||
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,skip_changelog" | ||
|
||
- name: Configure git and commit CHANGELOG | ||
run: | | ||
git config --global user.email "${GIT_USER_EMAIL}" | ||
git config --global user.name "${GIT_USER_NAME}" | ||
git commit CHANGELOG.md -m "Release ${GITHUB_REF#refs/tags/}" | ||
- name: Move tag to new HEAD | ||
run: | | ||
TAG_MSG=.github/utils/release_tag_msg.txt | ||
sed -i "s|TAG_NAME|${GITHUB_REF#refs/tags/}|" "${TAG_MSG}" | ||
git tag -af -F "${TAG_MSG}" ${GITHUB_REF#refs/tags/} | ||
- name: Update '${{ env.PUBLISH_UPDATE_BRANCH }}' | ||
uses: CasperWA/push-protected@v2 | ||
with: | ||
token: ${{ secrets.ORG_RELEASE_PAT }} | ||
branch: ${{ env.PUBLISH_UPDATE_BRANCH }} | ||
unprotect_reviews: true | ||
sleep: 15 | ||
force: true | ||
tags: true | ||
|
||
- name: Create release-specific changelog | ||
uses: CharMixer/auto-changelog-action@v1 | ||
with: | ||
token: ${{ secrets.ORG_RELEASE_PAT }} | ||
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }} | ||
since_tag: "${{ env.PREVIOUS_VERSION }}" | ||
output: "release_changelog.md" | ||
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,CI,skip_changelog" | ||
|
||
- name: Append changelog to release body | ||
run: | | ||
gh api /repos/${{ github.repository }}/releases/${{ github.event.release.id }} --jq '.body' > release_body.md | ||
cat release_changelog.md >> release_body.md | ||
gh api /repos/${{ github.repository }}/releases/${{ github.event.release.id }} -X PATCH -F body='@release_body.md' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_RELEASE_PAT }} | ||
|
||
publish: | ||
name: "Publish on PyPI" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
if: github.repository == 'datalab-org/datalab-api' && startsWith(github.ref, 'refs/tags/v') | ||
needs: [release] | ||
|
||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
ref: ${{ env.PUBLISH_UPDATE_BRANCH }} | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build source distribution | ||
run: | | ||
pip install -U build | ||
python -m build | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
nav: | ||
- index.md | ||
- reference.md | ||
- "Example notebook": examples/client_example.ipynb | ||
- changelog.md |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../CHANGELOG.md |
File renamed without changes.
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
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