Skip to content

Commit 8ac235b

Browse files
Use devcontainer for packaging (#8)
1 parent bc09f5b commit 8ac235b

8 files changed

Lines changed: 92 additions & 51 deletions

File tree

.devcontainer

Submodule .devcontainer added at 190f80b

.github/workflows/python-release.yml

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

.github/workflows/python-test.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test and Release
2+
3+
on:
4+
push:
5+
branches: main
6+
tags: v*.*.*
7+
8+
pull_request:
9+
branches: [ "main" ]
10+
types:
11+
- synchronize
12+
- opened
13+
- reopened
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.sha }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test:
21+
name: Build and test
22+
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
# Gives the action the necessary permissions for publishing new
27+
# comments in pull requests.
28+
pull-requests: write
29+
contents: write
30+
statuses: write
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
- name: Verify changes
36+
uses: EffectiveRange/python-verify-github-action@v1
37+
with:
38+
coverage-threshold: '95'
39+
40+
release:
41+
if: startsWith(github.ref, 'refs/tags/')
42+
needs: test
43+
44+
name: Publish and release
45+
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Package and publish
50+
uses: EffectiveRange/python-package-github-action@v2
51+
with:
52+
use-devcontainer: 'true'
53+
container-config: 'armhf-container'
54+
packaging-command: 'pack_python . --all'
55+
- name: Release
56+
uses: EffectiveRange/version-release-github-action@v1

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".devcontainer"]
2+
path = .devcontainer
3+
url = https://github.com/EffectiveRange/devcontainer-defs

.vscode/settings.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"editor.rulers": [
3+
120
4+
],
5+
"[python]": {
6+
"editor.defaultFormatter": "ms-python.black-formatter",
7+
"editor.formatOnSave": true
8+
},
9+
"black-formatter.args": [
10+
"--skip-string-normalization",
11+
"--line-length",
12+
"120"
13+
],
14+
"python.testing.unittestArgs": [
15+
"-v",
16+
"-s",
17+
"./tests",
18+
"-p",
19+
"*test.py"
20+
],
21+
"python.testing.pytestEnabled": false,
22+
"python.testing.unittestEnabled": true
23+
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
[![Test and Release](https://github.com/EffectiveRange/python-context-logger/actions/workflows/test_and_release.yml/badge.svg)](https://github.com/EffectiveRange/python-context-logger/actions/workflows/test_and_release.yml)
3+
[![Coverage badge](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=coverage&query=%24.message&url=https%3A%2F%2Fraw.githubusercontent.com%2EffectiveRange%2Fpython-context-logger%2Fpython-coverage-comment-action-data%2Fendpoint.json)](https://htmlpreview.github.io/?https://github.com/EffectiveRange/python-context-logger/blob/python-coverage-comment-action-data/htmlcov/index.html)
4+
15
# python-context-logger
26
Contextual structured logging library for Python.
37

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ directory = coverage/html
4949

5050
[coverage:json]
5151
output = coverage/coverage.json
52+
53+
[pack-python]
54+
packaging =
55+
wheel
56+
fpm-deb

0 commit comments

Comments
 (0)