-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge https://github.com/donjon-painter/donjon-painter into master
Keep in sync with donjon-painter.
- Loading branch information
Showing
8 changed files
with
196 additions
and
31 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,32 @@ | ||
name: Python CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.5, 3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest |
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,128 @@ | ||
name: Build Executables | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
|
||
job_build: | ||
name: ${{ matrix.os }} Binaries | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu | ||
add-data: 'themes:themes' | ||
- os: macos | ||
add-data: 'themes:themes' | ||
- os: windows | ||
add-data: 'themes;themes' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pyinstaller | ||
pip install -r requirements.txt | ||
- name: Build Executable | ||
run: | | ||
mkdir ${{ matrix.os }} | ||
cd donjon_painter | ||
python -O -m PyInstaller --clean --onefile --add-data="${{ matrix.add-data }}" --name donjon-painter --distpath ../${{ matrix.os }} painter.py | ||
- name: Package Executable | ||
run: | | ||
mv ./LICENSE ./${{ matrix.os }} | ||
mv ./README.rst ./${{ matrix.os }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.os }} | ||
path: ${{ matrix.os }} | ||
|
||
|
||
job_upload: | ||
name: Upload Release Assets | ||
needs: job_build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# Github Actions is weird about environment variables. | ||
# Setting a variable in this way makes it available to all subsequent steps in the job. | ||
# The only way to get the tag is to extract it from github-ref. | ||
# For example, GITHUB_REF='refs/tags/v1.5'. | ||
- name: Set environment | ||
run: | | ||
export TAG="${GITHUB_REF#'refs/tags/'}" | ||
echo "::set-env name=GH_TAG::$TAG" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: bin/ | ||
|
||
# Zip all artifacts | ||
- name: Zip Archives | ||
run: | | ||
cd bin | ||
chmod +x ./macos/donjon-painter | ||
chmod +x ./ubuntu/donjon-painter | ||
for idir in */; | ||
do | ||
(cd "$idir" && zip -r "../${idir%/}.zip" .); | ||
done | ||
# We have to upload assets individually using upload-release-asset@v1 | ||
# There isn't a matrix for steps. | ||
- name: Upload Linux Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./bin/ubuntu.zip | ||
asset_name: donjon-painter-linux-${{ env.GH_TAG }}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Upload MacOS Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./bin/macos.zip | ||
asset_name: donjon-painter-macos-${{ env.GH_TAG }}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Upload Windows Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./bin/windows.zip | ||
asset_name: donjon-painter-windows-${{ env.GH_TAG }}.zip | ||
asset_content_type: application/zip |
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 |
---|---|---|
@@ -1 +1 @@ | ||
pyinstaller --name="donjon-painter-0.9.4" --paths="../donjon_painter" --add-data="../donjon_painter/themes;themes" --distpath="../dist" --upx-dir="./upx-3.95-win32" --workpath="../build" --onefile ..\donjon_painter\painter.py | ||
pyinstaller --name="donjon-painter-0.9.5" --paths="../donjon_painter" --add-data="../donjon_painter/themes;themes" --distpath="../dist" --upx-dir="./upx-3.95-win32" --workpath="../build" --onefile ..\donjon_painter\painter.py |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
version=0.9.4 | ||
version=0.9.5 | ||
|
||
twine upload --repository-url https://test.pypi.org/legacy/ ../dist/donjon_painter-$version-py3-none-any.whl ../dist/donjon-painter-$version.tar.gz |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
version=0.9.4 | ||
version=0.9.5 | ||
|
||
twine upload ../dist/donjon_painter-$version-py3-none-any.whl ../dist/donjon-painter-$version.tar.gz |
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,7 @@ | ||
# content of test_sample.py | ||
def func(x): | ||
return x + 1 | ||
|
||
|
||
def test_answer(): | ||
assert func(3) == 4 |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
setuptools.setup( | ||
name='donjon-painter', | ||
version='0.9.4', | ||
version='0.9.5', | ||
author='Korvin Roganov', | ||
author_email='[email protected]', | ||
license='GPLv3', | ||
|