| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + name: Release | ||
| 2 | + | ||
| 3 | + on: | ||
| 4 | + schedule: | ||
| 5 | + - cron: '0 0 28 * *' # Monthly auto-release | ||
| 6 | + workflow_dispatch: # Manual trigger for quick fixes | ||
| 7 | + | ||
| 8 | + jobs: | ||
| 9 | + release: | ||
| 10 | + runs-on: ubuntu-latest | ||
| 11 | + steps: | ||
| 12 | + - uses: actions/checkout@v2 | ||
| 13 | + with: | ||
| 14 | + fetch-depth: 0 | ||
| 15 | + - name: Python Semantic Release | ||
| 16 | + uses: relekang/python-semantic-release@master | ||
| 17 | + with: | ||
| 18 | + github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| 19 | + pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,21 +4,6 @@ stages: | |||
| 4 | 4 | - deploy | |
| 5 | 5 | - deploy-latest | |
| 6 | 6 | ||
| 7 | - deploy: | ||
| 8 | - stage: deploy | ||
| 9 | - script: | ||
| 10 | - - pip install -U setuptools wheel twine | ||
| 11 | - - python setup.py sdist bdist_wheel | ||
| 12 | - # test package | ||
| 13 | - - python3 -m venv test | ||
| 14 | - - . test/bin/activate | ||
| 15 | - - pip install -U dist/python_gitlab*.whl | ||
| 16 | - - gitlab -h | ||
| 17 | - - deactivate | ||
| 18 | - - twine upload --skip-existing -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/* | ||
| 19 | - only: | ||
| 20 | - - tags | ||
| 21 | - | ||
| 22 | 7 | deploy_image: | |
| 23 | 8 | stage: deploy | |
| 24 | 9 | image: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -213,3 +213,27 @@ To cleanup the environment delete the container: | |||
| 213 | 213 | docker rm -f gitlab-test | |
| 214 | 214 | docker rm -f gitlab-runner-test | |
| 215 | 215 | ||
| 216 | + Releases | ||
| 217 | + -------- | ||
| 218 | + | ||
| 219 | + A release is automatically published once a month on the 28th if any commits merged | ||
| 220 | + to the main branch contain commit message types that signal a semantic version bump | ||
| 221 | + (``fix``, ``feat``, ``BREAKING CHANGE:``). | ||
| 222 | + | ||
| 223 | + Additionally, the release workflow can be run manually by maintainers to publish urgent | ||
| 224 | + fixes, either on GitHub or using the ``gh`` CLI with ``gh workflow run release.yml``. | ||
| 225 | + | ||
| 226 | + **Note:** As a maintainer, this means you should carefully review commit messages | ||
| 227 | + used by contributors in their pull requests. If scopes such as ``fix`` and ``feat`` | ||
| 228 | + are applied to trivial commits not relevant to end users, it's best to squash their | ||
| 229 | + pull requests and summarize the addition in a single conventional commit. | ||
| 230 | + This avoids triggering incorrect version bumps and releases without functional changes. | ||
| 231 | + | ||
| 232 | + The release workflow uses `python-semantic-release | ||
| 233 | + <https://python-semantic-release.readthedocs.io>`_ and does the following: | ||
| 234 | + | ||
| 235 | + * Bumps the version in ``__version__.py`` and adds an entry in ``CHANGELOG.md``, | ||
| 236 | + * Commits and tags the changes, then pushes to the main branch as the ``github-actions`` user, | ||
| 237 | + * Creates a release from the tag and adds the changelog entry to the release notes, | ||
| 238 | + * Uploads the package as assets to the GitHub release, | ||
| 239 | + * Uploads the package to PyPI using ``PYPI_TOKEN`` (configured as a secret). | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + [tool.semantic_release] | ||
| 2 | + version_variable = "gitlab/__version__.py:__version__" | ||
| 3 | + commit_subject = "chore: release v{version}" | ||
| 4 | + commit_message = "" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments