-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from angulo-solido/add-release-action
Add Release Workflow
- Loading branch information
Showing
16 changed files
with
882 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release Terrabutler | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release-terrabutler: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get Current Tag | ||
uses: WyriHaximus/github-action-get-previous-tag@master | ||
id: tag | ||
- name: Build Python Module | ||
uses: JackMcKew/pyinstaller-action-linux@main | ||
with: | ||
path: terrabutler | ||
spec: terrabutler | ||
- name: Copy needed files to build directory | ||
run: | | ||
cp README.md src/dist/linux | ||
- name: Create archive of build (.tar.gz) | ||
uses: sibiraj-s/action-archiver@v1 | ||
with: | ||
working-directory: './' | ||
path: 'src/dist/linux/**' | ||
format: tar | ||
gzip: true | ||
output: terrabutler-${{ RUNNER_OS }}-${{ RUNNER_ARCH }}-${{ steps.tag.outputs.tag }}.tar.gz | ||
- name: Add artifact to Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: terrabutler-${{ RUNNER_OS }}-${{ RUNNER_ARCH }}-${{ steps.tag.outputs.tag }}.tar.gz | ||
- name: Upload artifact to S3 bucket | ||
uses: zdurham/s3-upload-github-action@master | ||
with: | ||
args: --acl public-read | ||
env: | ||
FILE: ./terrabutler-${{ RUNNER_OS }}-${{ RUNNER_ARCH }}-${{ steps.tag.outputs.tag }}.tar.gz | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
S3_KEY: ${{ secrets.AWS_S3_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Test Code | |
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
lint-python: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import sys | ||
from terrabutler.click import main | ||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import os | ||
import re | ||
from setuptools import setup | ||
|
||
|
||
def find_version(path): | ||
version_file = read(path) | ||
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", | ||
version_file, re.M) | ||
if version_match: | ||
return version_match.group(1) | ||
raise RuntimeError("Unable to find version string.") | ||
|
||
|
||
# Utility function to read the README file. | ||
# Used for the long_description. It's nice, because now 1) we have a top level | ||
# README file and 2) it's easier to type in the README file than to put a raw | ||
# string in below ... | ||
def read(fname): | ||
return open(os.path.join(os.path.dirname(__file__), fname)).read() | ||
|
||
|
||
setup( | ||
name="terrabutler", | ||
version=find_version("terrabutler/__init__.py"), | ||
author="AnguloSólido", | ||
description=("A tool to manage Terraform projects easier."), | ||
long_description=read("README.md"), | ||
license="GPL-3.0", | ||
keywords="terraform manager", | ||
url="https://github.com/angulo-solido/terrabutler", | ||
scripts=["bin/terrabutler"], | ||
packages=["terrabutler"], | ||
install_requires=[ | ||
"boto3>=1.20.0", | ||
"botocore>=1.20.0", | ||
"click>=8.0.0", | ||
"jmespath>=0.10.0", | ||
"mccabe>=0.6.0", | ||
"pycodestyle>=2.8.0", | ||
"pyflakes>=2.4.0", | ||
"python-dateutil>=2.8.0", | ||
"s3transfer>=0.5.0", | ||
"six>=1.16.0", | ||
"urllib3>=1.26.0" | ||
], | ||
python_requires=">= 3.6", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Natural Language :: English", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Utilities" | ||
], | ||
project_urls={ | ||
"Source": "https://github.com/angulo-solido/terrabutler", | ||
"Changelog": "https://github.com/angulo-solido/terrabutler/releases", | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__name__ = "terrabutler" | ||
__version__ = '1.0.0-beta' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import sys | ||
from terrabutler.click import main | ||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis( | ||
['__main__.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False, | ||
) | ||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
[], | ||
exclude_binaries=True, | ||
name='terrabutler', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
console=True, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
) | ||
coll = COLLECT( | ||
exe, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
name='terrabutler', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters