Skip to content

Commit 578c0f8

Browse files
committed
Initial release setup
1 parent 8217ae8 commit 578c0f8

File tree

12 files changed

+71
-70
lines changed

12 files changed

+71
-70
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,30 @@
1-
name: Create and publish a Docker image
2-
31
on:
42
push:
5-
branches: ['main', 'dev']
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
66

7-
env:
8-
REGISTRY: ghcr.io
9-
IMAGE_NAME: ${{ github.repository }}
7+
name: Create Release
108

119
jobs:
12-
build-and-push-image:
10+
build:
11+
name: Create Release
1312
runs-on: ubuntu-latest
14-
permissions:
15-
contents: read
16-
packages: write
17-
1813
steps:
19-
- name: Checkout repository
14+
- name: Checkout code
2015
uses: actions/checkout@v2
21-
22-
- name: Run Snyk to check for vulnerabilities
23-
uses: snyk/actions/python-3.8@master
16+
17+
- name: Create Release
18+
id: create_release
19+
uses: actions/create-release@v1
2420
env:
25-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
26-
with:
27-
args: --severity-threshold=high
28-
29-
- name: Log in to the Container registry
30-
uses: docker/login-action@v1
31-
with:
32-
registry: ${{ env.REGISTRY }}
33-
username: ${{ github.actor }}
34-
password: ${{ secrets.GITHUB_TOKEN }}
35-
36-
- name: Extract metadata (tags, labels) for Docker
37-
id: meta
38-
uses: docker/metadata-action@v3
39-
with:
40-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41-
42-
- name: Build and push Docker image
43-
uses: docker/build-push-action@v2
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
4422
with:
45-
context: .
46-
push: true
47-
tags: ${{ steps.meta.outputs.tags }}
48-
labels: ${{ steps.meta.outputs.labels }}
23+
tag_name: ${{ github.ref }}
24+
release_name: Release ${{ github.ref }}
25+
body: |
26+
Changes in this Release
27+
- First Change
28+
- Second Change
29+
draft: false
30+
prerelease: false

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"python.linting.pylintEnabled": false,
3-
"python.linting.enabled": true,
3+
"python.linting.enabled": false,
44
"python.linting.flake8Enabled": true
55
}

Dockerfile

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Tristan Nolde
3+
Copyright (c) 2022 Tristan Nolde
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.MD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[![GitHub license](https://img.shields.io/github/license/TrisNol/sample-python-repo.svg)](https://github.com/TrisNol/sample-python-repo/blob/master/LICENSE)
2-
[![Github all releases](https://img.shields.io/github/downloads/TrisNol/sample-python-repo/total.svg)](https://github.com/users/TrisNol/packages/container/package/sample-python-repo)
3-
[![GitHub forks](https://img.shields.io/github/forks/TrisNol/sample-python-repo.svg?style=social&label=Fork&maxAge=2592000)](https://github.com/TrisNol/sample-python-repo)
4-
# Sample Python Repo
5-
This repo contains a skeleton for Python projects containing some basic DevOps´ components like CI/CD pipelines.
1+
[![GitHub license](https://img.shields.io/github/license/TrisNol/python-sample-package.svg)](https://github.com/TrisNol/python-sample-package/blob/master/LICENSE)
2+
[![Github all releases](https://img.shields.io/github/downloads/TrisNol/python-sample-package/total.svg)](https://github.com/users/TrisNol/packages/container/package/python-sample-package)
3+
[![GitHub forks](https://img.shields.io/github/forks/TrisNol/python-sample-package.svg?style=social&label=Fork&maxAge=2592000)](https://github.com/TrisNol/python-sample-package)
4+
# Python saple release
5+
This repo contains a skeleton for Python packages containing some basic DevOps´ components like CI/CD pipelines.
66

77
## Linting
88
The code of this repo will be linted with [PyLint](https://pylint.org/) automatically on each push and pull-request to ensure that the files are correctly formatted in order to improve readability.

app/app.py

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

requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
# Add other libraries here - the following is just a placeholder
2-
numpy==1.22.2
3-
pandas==1.4.1

setup.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import setuptools
2+
3+
with open("README.md", "r", encoding="utf-8") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="python-sample-package",
8+
version="0.0.1",
9+
author="Tristan Nolde",
10+
author_email="author@example.com",
11+
description="A Python sample package",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/TrisNol/python-sample-package",
15+
project_urls={
16+
"Bug Tracker": "https://github.com/TrisNol/python-sample-package/issues",
17+
},
18+
classifiers=[
19+
"Programming Language :: Python :: 3",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
],
23+
package_dir={"": "src"},
24+
packages=setuptools.find_packages(where="src"),
25+
python_requires=">=3.8",
26+
)

src/example_package/example.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
def add_one(number):
3+
"""Add 1 to the provided number.
4+
5+
Args:
6+
number (any): Input
7+
8+
Returns:
9+
any: Output
10+
"""
11+
return number+1

0 commit comments

Comments
 (0)