Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(ci): automate releases#1427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intomasterfromchore/automate-releases
May 10, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions.github/workflows/release.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
name: Release

on:
schedule:
- cron: '0 0 28 * *' # Monthly auto-release
workflow_dispatch: # Manual trigger for quick fixes

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
15 changes: 0 additions & 15 deletions.gitlab-ci.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,21 +4,6 @@ stages:
-deploy
-deploy-latest

deploy:
stage:deploy
script:
-pip install -U setuptools wheel twine
-python setup.py sdist bdist_wheel
# test package
-python3 -m venv test
-. test/bin/activate
-pip install -U dist/python_gitlab*.whl
-gitlab -h
-deactivate
-twine upload --skip-existing -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
only:
-tags

deploy_image:
stage:deploy
image:
Expand Down
24 changes: 24 additions & 0 deletionsREADME.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -213,3 +213,27 @@ To cleanup the environment delete the container:
docker rm -f gitlab-test
docker rm -f gitlab-runner-test

Releases
--------

A release is automatically published once a month on the 28th if any commits merged
to the main branch contain commit message types that signal a semantic version bump
(``fix``, ``feat``, ``BREAKING CHANGE:``).

Additionally, the release workflow can be run manually by maintainers to publish urgent
fixes, either on GitHub or using the ``gh`` CLI with ``gh workflow run release.yml``.

**Note:** As a maintainer, this means you should carefully review commit messages
used by contributors in their pull requests. If scopes such as ``fix`` and ``feat``
are applied to trivial commits not relevant to end users, it's best to squash their
pull requests and summarize the addition in a single conventional commit.
This avoids triggering incorrect version bumps and releases without functional changes.

The release workflow uses `python-semantic-release
<https://python-semantic-release.readthedocs.io>`_ and does the following:

* Bumps the version in ``__version__.py`` and adds an entry in ``CHANGELOG.md``,
* Commits and tags the changes, then pushes to the main branch as the ``github-actions`` user,
* Creates a release from the tag and adds the changelog entry to the release notes,
* Uploads the package as assets to the GitHub release,
* Uploads the package to PyPI using ``PYPI_TOKEN`` (configured as a secret).
4 changes: 4 additions & 0 deletionspyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
[tool.semantic_release]
version_variable = "gitlab/__version__.py:__version__"
commit_subject = "chore: release v{version}"
commit_message = ""

[8]ページ先頭

©2009-2025 Movatter.jp