Skip to content

Commit 6474845

Browse files
committed
revert semantic release
1 parent d2f183b commit 6474845

6 files changed

Lines changed: 50 additions & 30 deletions

File tree

src/.github/workflows/automerge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Merge PR
1313
run: |
14-
gh pr merge --auto --squash --body="[ci skip]" "$PR_URL"
14+
gh pr merge --auto --squash --body="[cd skip]" "$PR_URL"
1515
gh pr review --approve "$PR_URL"
1616
env:
1717
PR_URL: ${{ github.event.pull_request.html_url }}

src/.github/workflows/ci.yaml.jinja

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
jobs:
10-
lint:
10+
build:
1111
runs-on: ubuntu-latest
1212
if: "!contains(github.event.head_commit.message, 'ci skip')"
1313
steps:
@@ -30,15 +30,51 @@ jobs:
3030
run: poetry run task lint
3131
- name: Run tests
3232
run: poetry run task test
33-
- name: Release
34-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
35-
run: |
36-
pip install python-semantic-release
37-
git config --global user.name "github-actions"
38-
git config --global user.email "action@github.com"
39-
poetry run task release
33+
34+
release:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'cd skip')
38+
steps:
39+
- uses: actions/checkout@v2
40+
- name: Bump version
41+
uses: TriPSs/conventional-changelog-action@v3
42+
id: version
43+
with:
44+
github-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
45+
git-user-name: "GitHub Actions"
46+
git-user-email: "action@github.com"
47+
version-file: pyproject.toml
48+
version-path: tool.poetry.version
49+
preset: conventionalcommits
50+
output-file: false
51+
- name: Publish to GitHub
52+
if: steps.version.outputs.skipped == 'false'
53+
run: gh release create "$TAG" --notes "$BODY"
54+
env:
55+
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
56+
TAG: {% raw %}${{ steps.version.outputs.tag }}{% endraw %}
57+
BODY: {% raw %}${{ steps.version.outputs.clean_changelog }}{% endraw %}
58+
{% if not private -%}
59+
- name: Publish to PyPI
60+
if: steps.version.outputs.skipped == 'false'
61+
run: pip install poetry && poetry publish --build
4062
env:
4163
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
42-
{% if not private -%}
4364
PYPI_TOKEN: {% raw %}${{ secrets.PYPI_TOKEN }}{% endraw %}
44-
{% endif -%}
65+
{% endif -%}
66+
{% if docker -%}
67+
- uses: satackey/action-docker-layer-caching@v0.0.11
68+
if: steps.version.outputs.skipped == 'false'
69+
- name: Publish to DockerHub
70+
if: steps.version.outputs.skipped == 'false'
71+
run: |
72+
echo "$PASSWORD" | docker login https://ghcr.io -u "$USERNAME" --password-stdin
73+
docker build -t $REPO:$TAG -t $REPO:latest .
74+
docker push -a $REPO
75+
env:
76+
USERNAME: {% raw %}${{ github.actor }}{% endraw %}
77+
PASSWORD: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
78+
REPO: ghcr.io/{% raw %}${{ github.repository }}{% endraw %}
79+
TAG: {% raw %}${{ steps.version.outputs.tag }}{% endraw %}
80+
{% endif -%}

src/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ Releasing is fully automated via our [CI pipeline](.github/workflows/ci.yaml). O
5252
1. Determine if a new version should be released (using [conventional commits](https://www.conventionalcommits.org/))
5353
1. If so, bump the version and publish a new release
5454

55-
To override this behavior, include `[ci skip]` in your commit message.
55+
To override this behavior, include `[cd skip]` in your commit message.

src/README.md.jinja

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# {{project_name | replace('_', ' ') | title}}
22

3-
[![CI](https://github.com/{{repo_username}}/{{repo_name}}/workflows/CI/badge.svg)](https://github.com/{{repo_username}}/{{repo_name}}/actions/workflows/ci.yaml)
3+
[![ci](https://github.com/{{repo_username}}/{{repo_name}}/workflows/CI/badge.svg)](https://github.com/{{repo_username}}/{{repo_name}}/actions/workflows/ci.yaml)
44
{% if not private -%}
55
[![pypi version](https://img.shields.io/pypi/v/{{project_name}}.svg)](https://pypi.org/project/{{project_name}}/)
6-
[![pypi pyversions](https://img.shields.io/pypi/pyversions/{{project_name}})](https://pypi.org/project/{{project_name}}/)
76
{% endif -%}
87
[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
98
[![checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
10-
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
119

1210
{{project_description}}
1311

src/postgenerate.sh.jinja

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ set -euo pipefail
66
GREEN="$(tput setaf 2 2>/dev/null || printf '')"
77
RESET="$(tput sgr0 2>/dev/null || printf '')"
88

9-
# Delete this file
10-
rm -- "$0"
9+
rm -- "$0" # Self destruct
1110

1211
# If already initialized, abort
1312
if [ -d .git ] || [ -n "${COPIER_SKIP_INIT:-}" ]; then

src/pyproject.toml.jinja

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ docs = { cmd = "mkdocs serve -f docs/mkdocs.yaml", help = "Serve documentation"}
3333
{% endif -%}
3434
lint = { cmd = "pre-commit run --all-files", help = "Run linters and formatters" }
3535
test = { cmd = "pytest", help = "Run tests" }
36-
release = { cmd = "semantic-release publish", help = "Release new version" }
3736

3837
[tool.flake8]
3938
max-line-length = 88
@@ -49,18 +48,6 @@ ignore_missing_imports = true
4948
[tool.pytest.ini_options]
5049
testpaths = ["tests"]
5150

52-
[tool.semantic_release]
53-
branch = "main"
54-
version_variable = "pyproject.toml:version"
55-
commit_subject = "chore(release): v{version}"
56-
commit_message = "[ci skip]"
57-
commit_author = "github-actions <action@github.com>"
58-
build_command = "poetry build"
59-
{% if private -%}
60-
upload_to_pypi = false
61-
{% endif -%}
62-
changelog_file = ".gitignore"
63-
6451
[build-system]
6552
requires = ["poetry-core>=1.0"]
6653
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)