Skip to content

Commit 858be41

Browse files
committed
ci: change release workflow
1 parent 7bd3d2e commit 858be41

File tree

5 files changed

+111
-135
lines changed

5 files changed

+111
-135
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,29 @@
11
name: Release
2+
23
on: [workflow_dispatch]
34

45
jobs:
5-
bumpversion:
6-
runs-on: ubuntu-latest
7-
outputs:
8-
version: ${{ steps.tag_version.outputs.new_version }}
9-
previous_tag: ${{ steps.tag_version.outputs.previous_tag }}
10-
bump_commit_sha: ${{ steps.bumpversion.outputs.commit_hash }}
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: Get next version
14-
id: tag_version
15-
uses: mathieudutour/github-tag-action@v6.0
16-
with:
17-
github_token: ${{ secrets.GITHUB_TOKEN }}
18-
default_bump: false
19-
default_prerelease_bump: false
20-
dry_run: true
21-
- name: Set up Python 3.8
22-
uses: actions/setup-python@v2
23-
with:
24-
python-version: "3.8"
25-
- name: Create bumpversion
26-
if: steps.tag_version.outputs.new_version
27-
run: |
28-
pip install bump2version
29-
bump2version --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg
30-
- name: Update Changelog
31-
if: steps.tag_version.outputs.new_version
32-
uses: stefanzweifel/changelog-updater-action@v1.6.2
33-
with:
34-
latest-version: ${{ steps.tag_version.outputs.new_tag }}
35-
release-notes: ${{ steps.tag_version.outputs.changelog }}
36-
- name: Commit bumpversion
37-
id: bumpversion
38-
if: steps.tag_version.outputs.new_version
39-
uses: stefanzweifel/git-auto-commit-action@v4.14.1
40-
with:
41-
branch: ${{ github.ref }}
42-
commit_message: "chore(release): preparing ${{ steps.tag_version.outputs.new_version }}"
43-
file_pattern: CHANGELOG.md setup.cfg drydock/*
446
release:
45-
needs: bumpversion
46-
if: needs.bumpversion.outputs.version
477
runs-on: ubuntu-latest
48-
outputs:
49-
tag: ${{ steps.tag_version.outputs.new_tag }}
50-
changelog: ${{ steps.tag_version.outputs.changelog }}
8+
concurrency: release
9+
permissions:
10+
id-token: write
11+
contents: write
12+
5113
steps:
52-
- uses: actions/checkout@v3
53-
- name: Create tag
54-
id: tag_version
55-
uses: mathieudutour/github-tag-action@v6.0
56-
with:
57-
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
commit_sha: ${{ needs.bumpversion.outputs.bump_commit_sha }}
59-
default_bump: false
60-
default_prerelease_bump: false
61-
- name: Create a GitHub release
62-
if: steps.tag_version.outputs.new_tag
63-
uses: ncipollo/release-action@v1
64-
with:
65-
tag: ${{ steps.tag_version.outputs.new_tag }}
66-
name: Release ${{ steps.tag_version.outputs.new_tag }}
67-
body: ${{ steps.tag_version.outputs.changelog }}
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Python Semantic Release
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
23+
- name: Install Semantic Release
24+
run: make install-semantic-release
25+
26+
- name: Run Semantic Release
27+
run: make release
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.DEFAULT_GOAL := help
2+
3+
install-semantic-release: ## install semantic-release
4+
@echo "Installing semantic-release."
5+
pip install python-semantic-release
6+
7+
release: ## release a new version
8+
@echo "Releasing a new version."
9+
semantic-release -vv version --changelog --push --tag --commit
10+
11+
selfcheck: ## check that the Makefile is well-formed
12+
@echo "The Makefile is well-formed."
13+
14+
ESCAPE = \033
15+
help: ## Print this help
16+
@grep -E '^([.a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
17+
| sed 's/######* \(.*\)/@ $(ESCAPE)[1;31m\1$(ESCAPE)[0m/g' | tr '@' '\n' \
18+
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'

pyproject.toml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "drydock"
7+
version = "15.9.0"
8+
description = "A Tutor plugin to manage our opinionated Open edX operations"
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
license = { text = "AGPLv3" }
12+
authors = [
13+
{ name = "eduNEXT" }
14+
]
15+
classifiers = [
16+
"Development Status :: 3 - Alpha",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: GNU Affero General Public License v3",
19+
"Operating System :: OS Independent",
20+
"Programming Language :: Python",
21+
"Programming Language :: Python :: 3.8",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
]
27+
dependencies = [
28+
"tutor>=17.0.2,<18.0.0"
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/edunext/drydock"
33+
Code = "https://github.com/edunext/drydock"
34+
"Issue tracker" = "https://github.com/edunext/drydock/issues"
35+
36+
[tool.setuptools.packages.find]
37+
where = ["."]
38+
exclude = ["tests*"]
39+
40+
[project.entry-points."tutor.plugin.v1"]
41+
drydock = "drydock.plugin"
42+
43+
[tool.isort]
44+
include_trailing_comma = true
45+
indent = " "
46+
line_length = 120
47+
multi_line_output = 3
48+
49+
[tool.wheel]
50+
universal = true
51+
52+
[tool.semantic_release]
53+
commit_message = "chore(release): preparing {version}"
54+
version_toml = [
55+
"pyproject.toml:project.version",
56+
]
57+
version_variables = [
58+
"drydock/__about__.py:__version__",
59+
]
60+
61+
[tool.semantic_release.branches.olive]
62+
match = "olive"
63+
64+
[tool.semantic_release.changelog.environment]
65+
keep_trailing_newline = true
66+
67+
[tool.semantic_release.remote]
68+
name = "origin"
69+
type = "github"
70+
ignore_token_for_push = false
71+
insecure = false

setup.cfg

Lines changed: 0 additions & 15 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)