Skip to content

Commit

Permalink
Merge branch 'cicd' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Oct 25, 2021
2 parents 10421f2 + 6d1e3bb commit d8f6985
Show file tree
Hide file tree
Showing 220 changed files with 2,318 additions and 4,892 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: pyRevitCI
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
# under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- uses: snickerbockers/submodules-init@v4

- name: Setup Python 3.9
uses: actions/setup-python@v2.2.2
with:
python-version: 3.9

- name: Install pipenv
run: |
pip install pipenv
pipenv install
- name: Check build environment
run: pipenv run pyrevit check

- name: Build Binaries
run: |
pipenv run pyrevit set year
pipenv run pyrevit set build
pipenv run pyrevit set products
pipenv run pyrevit build all
- name: Get Build Version
id: buildversion
uses: juliangruber/read-file-action@v1
with:
path: pyrevitlib/pyrevit/version

- name: Sign Binaries
uses: skymatic/code-sign-action@v1
with:
certificate: '${{ secrets.CERTIFICATE }}'
password: '${{ secrets.PASSWORD }}'
certificatesha1: '${{ secrets.CERTIFICATESHA1 }}'
certificatename: '${{ secrets.CERTIFICATENAME }}'
description: 'pyRevit'
timestampUrl: 'http://timestamp.digicert.com'
folder: 'bin'
recursive: true

- name: Build Installers
run: |
pipenv run pyrevit build installers
- name: Sign Installers
uses: skymatic/code-sign-action@v1
with:
certificate: '${{ secrets.CERTIFICATE }}'
password: '${{ secrets.PASSWORD }}'
certificatesha1: '${{ secrets.CERTIFICATESHA1 }}'
certificatename: '${{ secrets.CERTIFICATENAME }}'
description: 'pyRevit'
timestampUrl: 'http://timestamp.digicert.com'
folder: 'dist'
recursive: true

# default retention period is 90 days
# https://github.com/marketplace/actions/upload-a-build-artifact#retention-period
- name: Upload Installers
uses: actions/upload-artifact@v2
with:
name: pyrevit-installers
path: |
dist/pyRevit_${{ steps.buildversion.outputs.content }}_signed.exe
dist/pyRevit_${{ steps.buildversion.outputs.content }}_admin_signed.exe
dist/pyRevit_CLI_${{ steps.buildversion.outputs.content }}_signed.exe
dist/pyRevit_CLI_${{ steps.buildversion.outputs.content }}_admin_signed.exe
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,20 @@
"--line-length=80"
],
"editor.formatOnSave": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Icon?": true,
"**/Thumbs.db": true,
"**/.vs": true,
"**/.sync": true,
"*/**/bin": true,
"**/obj": true,
"**/__pycache__": true,
"**/Prerequisites": true,
},
"python.pythonPath": "C:\\Users\\ehsan\\.virtualenvs\\pyrevit-dev-2PO7Kqjk\\Scripts\\python.exe"
}
Empty file removed bin/pyrevit.admin
Empty file.
76 changes: 0 additions & 76 deletions bin/pyrevit.manifest

This file was deleted.

Empty file removed bin/pyrevit.user
Empty file.
38 changes: 38 additions & 0 deletions dev/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputPath>bin\$(Configuration)\</OutputPath>
<PyRevitRootDir>$(MSBuildThisFileDirectory)\..\</PyRevitRootDir>

<PyRevitBinDir>$(PyRevitRootDir)\bin\</PyRevitBinDir>
<PyRevitEnginesDir>$(PyRevitBinDir)engines\</PyRevitEnginesDir>

<PyRevitDevDir>$(PyRevitRootDir)\dev\</PyRevitDevDir>
<PyRevitDevLibsDir>$(PyRevitDevDir)\libs\</PyRevitDevLibsDir>
<PyRevitDevModulesDir>$(PyRevitDevDir)\modules\</PyRevitDevModulesDir>

<PyRevitLibDir>$(PyRevitRootDir)\pyrevitlib\</PyRevitLibDir>
<PyRevitExtDir>$(PyRevitRootDir)\extensions\</PyRevitExtDir>
</PropertyGroup>

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net48</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<Version>4.8.8</Version>
<Copyright>Copyright © 2014-2021</Copyright>
<Company>pyRevitLabs.io</Company>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions dev/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
12 changes: 9 additions & 3 deletions dev/_autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ def parse_docopts(docopts_filepath):
def build_autocmp(_: Dict[str, str]):
"""Build CLI shell autocomplete utility"""
print("Updating autocomplete utility dependencies...")
utils.system(["go", "get", "github.com/posener/complete"])
utils.system(
["go", "get", "-u", r"./..."],
cwd=op.abspath(configs.AUTOCOMPPATH)
)
print("Autocomplete utility dependencies successfully updated")

# generate go autocomplete source from usage patterns
Expand All @@ -223,6 +226,9 @@ def build_autocmp(_: Dict[str, str]):
print("Building autocomplete utility...")
target = op.abspath(configs.AUTOCOMPBIN)
utils.system(["go", "fmt", configs.AUTOCOMP])
utils.system(["go", "build", "-o", target, configs.AUTOCOMP])
utils.system(
["go", "build", "-o", target, op.abspath(configs.AUTOCOMP)],
cwd=op.abspath(configs.AUTOCOMPPATH)
)
print("Building autocomplete utility completed successfully")
os.remove(configs.AUTOCOMP)
# os.remove(configs.AUTOCOMP)
2 changes: 1 addition & 1 deletion dev/_buildall.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ARTIFACTS = ['bin', 'obj', '.vs', 'TestResults']


def build_clean(_: Dict[str, str]):
def clean_build(_: Dict[str, str]):
"""Clean bin and obj from projects"""
for dirname, subdirs, _ in os.walk(configs.DEVPATH):
for subdir in subdirs:
Expand Down
8 changes: 4 additions & 4 deletions dev/_install.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Manage tasks related to the build environment"""
# pylint: disable=invalid-name,broad-except
import os.path as op
from collections import namedtuple
from typing import Dict

Expand All @@ -9,11 +10,10 @@


REQUIRED_TOOLS = [
RequiredTool(name="msbuild", get="", step="build"),
RequiredTool(name="dotnet", get="", step="build"),
RequiredTool(name="go", get="", step="build"),
RequiredTool(name="gcc", get="", step="build"),
RequiredTool(name="signtool", get="", step="release"),
RequiredTool(name="advancedinstaller.com", get="", step="release"),
RequiredTool(name="iscc", get=r"C:\Program Files (x86)\Inno Setup 6", step="release"),
]


Expand All @@ -27,7 +27,7 @@ def check(_: Dict[str, str]):
all_pass = True
# check required tools
for rtool in REQUIRED_TOOLS:
has_tool = utils.where(rtool.name)
has_tool = utils.where(op.join(rtool.get, rtool.name))
if has_tool:
print(utils.colorize(f"[ <grn>PASS</grn> ]\t{rtool.name} is ready"))
else:
Expand Down
19 changes: 10 additions & 9 deletions dev/_labs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import os.path as op
import logging
from typing import Dict
from typing import Dict, Optional

# dev scripts
from scripts import utils
Expand All @@ -19,7 +19,7 @@ def _abort(message):
sys.exit(1)


def _build(name: str, sln: str, config: str):
def _build(name: str, sln: str, config: str, print_output: Optional[bool] = False):
utils.ensure_windows()

# clean
Expand All @@ -29,13 +29,15 @@ def _build(name: str, sln: str, config: str):
print(f"Building {name}...")
report = utils.system(
[
"msbuild",
"dotnet",
"build",
slnpath,
"-t:Clean;Restore;Build",
f"-p:Configuration={config}",
]
"-c",
f"{config}",
],
dump_stdout=print_output
)
passed, report = utils.parse_msbuild_output(report)
passed, report = utils.parse_dotnet_build_output(report)
if not passed:
_abort(report)
else:
Expand All @@ -44,8 +46,7 @@ def _build(name: str, sln: str, config: str):

def build_engines(_: Dict[str, str]):
"""Build pyRevit engines"""
_build("default ironpython engine", configs.LOADERS, "Release")
_build("ironpython 2.7.* engines", configs.LOADERS, "Release")
_build("ironpython engines", configs.LOADERS, "Release")
_build("cpython 3.7 engine", configs.CPYTHONRUNTIME, "ReleasePY37")
_build("cpython 3.8 engine", configs.CPYTHONRUNTIME, "ReleasePY38")

Expand Down
Loading

0 comments on commit d8f6985

Please sign in to comment.