From 4b50fb4f1e3ca079eee7268390e0519af2aebfee Mon Sep 17 00:00:00 2001 From: Francisco Maranchello <49538907+franmaranchello@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:47:33 -0300 Subject: [PATCH] actions to update the version in the installer (#1) (#2) * Update README.md * actions to update the version in the installer adding license.txt file to the .iss file adding icons to the installer * unnecessary license deleted * Bump version, add version update to staging action, remove duplicate license. --------- Co-authored-by: Daniel Pinheiro <115579683+danielpinheiros@users.noreply.github.com> --- .github/workflows/production_actions.yml | 6 ++-- .github/workflows/staging_actions.yml | 4 +++ GitVersion.yml | 2 +- README.md | 26 +++++++++++++++++- SampleRevitAddin.Installer/InstallScript.iss | 17 ++++++++---- .../Images/Icons/e-verselogo.bmp | Bin 0 -> 98030 bytes .../Images/Icons/e-verselogo.ico | Bin 0 -> 50174 bytes .../SampleRevitAddin.Resources.csproj | 5 ++++ SampleRevitAddin.sln | 2 ++ 9 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 SampleRevitAddin.Resources/Images/Icons/e-verselogo.bmp create mode 100644 SampleRevitAddin.Resources/Images/Icons/e-verselogo.ico diff --git a/.github/workflows/production_actions.yml b/.github/workflows/production_actions.yml index d61090b..d675709 100644 --- a/.github/workflows/production_actions.yml +++ b/.github/workflows/production_actions.yml @@ -51,9 +51,9 @@ jobs: - name: Restore nuGet packages run: nuget restore $env:Solution_Name - - name: Set path for candle and light - run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH - shell: bash + # Update the version inside of the .iss file + - name: Updating the version into the installer + run: (Get-Content SampleRevitAddin.Installer/InstallScript.iss) -replace 'MyAppVersion "1.0.0"', 'MyAppVersion "v${{ steps.gitversion.outputs.majorMinorPatch }}"' | Out-File -encoding ASCII SampleRevitAddin.Installer/InstallScript.iss - name: Run MSBuild id: run-msbuild diff --git a/.github/workflows/staging_actions.yml b/.github/workflows/staging_actions.yml index ff95f54..1a1ac9c 100644 --- a/.github/workflows/staging_actions.yml +++ b/.github/workflows/staging_actions.yml @@ -51,6 +51,10 @@ jobs: - name: Restore nuGet packages run: nuget restore $env:Solution_Name + # Update the version inside of the .iss file + - name: Updating the version into the installer + run: (Get-Content SampleRevitAddin.Installer/InstallScript.iss) -replace 'MyAppVersion "1.0.0"', 'MyAppVersion "v${{ steps.gitversion.outputs.majorMinorPatch }}"' | Out-File -encoding ASCII SampleRevitAddin.Installer/InstallScript.iss + - name: Run MSBuild id: run-msbuild run: | diff --git a/GitVersion.yml b/GitVersion.yml index 0777cbe..af3452f 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,2 +1,2 @@ mode: ContinuousDeployment -next-version: 0.0.1 \ No newline at end of file +next-version: 0.1.1 \ No newline at end of file diff --git a/README.md b/README.md index bad2c91..7d4d39c 100644 --- a/README.md +++ b/README.md @@ -1 +1,25 @@ -# Snack.Revit.Addin \ No newline at end of file +# Snack.Revit.Addin + +## The Path + +As architects-coders, BIM developers, or just power users that build projects or products in the AEC industry, many of us have tested multiple approaches to efficiently coding Revit add-ins. I struggled with this for a while. + +My path and I’m sure many others, started with Dynamo, then PyRevit since I started coding in Python. The ease of use, lack of boilerplate code, and language choice make this a good starting point. But, when complexities arise, tapping into Revit’s API directly is usually the way to go. To do this, we need to use .NET Framework and its flagship programming language: C#. + +In that realm, we need to take care of building the application, packaging it, and deploying it in a frictionless, safe, and scalable way. The problem is there’s no standard recipe to do all this. In fact, [there are many](https://github.com/jeremytammik/VisualStudioRevitAddinWizard). So, how do we do it at e-verse? We’ve gone through plenty of iterations testing and improving our approach. We think sharing it may help other people in the industry who, like me, struggled with finding the most scalable and efficient way to do all this when we first started, using different tedious approaches to, for example, maintain an add-in for multiple Revit versions. + +--- + +## Our Recipe + +Our general add-in structure looks like this: + +1. A git code repository +2. A .NET Framework solution containing multiple projects + - The key here is to have different Class Library projects that compile a single Shared Project, so the code is the same but compiles targeting multiple Revit versions in a single operation +3. A set of NuGet dependencies +4. Post-build events to make debugging and releasing easier +5. A configuration file to manage settings and environment variables outside the main logic +6. CI/CD pipelines leveraging GitHub Actions to take care of releases for development, production, and any other environments needed + +There are several templates and wizards to do this, but here we present our own. Take a look at this [article](https://blog.e-verse.com/build/coding-revit-add-ins-the-e-verse-way) about it. diff --git a/SampleRevitAddin.Installer/InstallScript.iss b/SampleRevitAddin.Installer/InstallScript.iss index e41768b..e8fb483 100644 --- a/SampleRevitAddin.Installer/InstallScript.iss +++ b/SampleRevitAddin.Installer/InstallScript.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "SampleRevitAddin" -#define MyAppVersion "1.0" +#define MyAppVersion "1.0.0" #define MyAppPublisher "e-verse" [Setup] @@ -12,33 +12,38 @@ AppId={{264AD411-643C-43AC-9F07-34523C752100} AppName={#MyAppName} #define installerPath "{commonpf64}\e-verse\Snacks\" AppVersion={#MyAppVersion} -;AppVerName={#MyAppName} {#MyAppVersion} +AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} DefaultDirName={#installerPath} DisableDirPage=yes DefaultGroupName=Revit Extractor DisableProgramGroupPage=yes - #define Revit2020 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2020\" #define Revit2021 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2021\" #define Revit2022 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2022\" #define Revit2023 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2023\" - ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest OutputDir=.\Output OutputBaseFilename=SampleRevitAddin Compression=lzma SolidCompression=yes +SetupIconFile="..\SampleRevitAddin.Resources\Images\Icons\e-verselogo.ico" +OutputManifestFile=Setup-Manifest.txt +UninstallDisplayName="SampleRevitAddin Uninstall" +UninstallDisplayIcon="..\SampleRevitAddin.Resources\Images\Icons\e-verselogo.ico" +WizardSmallImageFile="..\SampleRevitAddin.Resources\Images\Icons\e-verselogo.bmp" WizardStyle=modern [Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "..\LICENSE" -[Files] +[Messages] +SetupWindowTitle = Setup {#SetupSetting("AppName")} Version: {#SetupSetting("AppVersion")} +[Files] Source: "..\SampleRevitAddin.2020\bin\Release\*"; DestDir: "{userappdata}{#Revit2020}\"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\SampleRevitAddin.Common\SampleRevitAddin.addin"; DestDir: "{userappdata}{#Revit2020}\"; Flags: ignoreversion recursesubdirs createallsubdirs diff --git a/SampleRevitAddin.Resources/Images/Icons/e-verselogo.bmp b/SampleRevitAddin.Resources/Images/Icons/e-verselogo.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0092171fc46be9b957427bd56d8cc80428324454 GIT binary patch literal 98030 zcmeI5F|OM>7KRl}^O|fR?KG*T5rXL_^#IvGS~b}~fB~k=22!ca2C@OWvMXPxkel2M z1XDdcAS=-Pv@KuhS~Sl&JQNk(@cCges_p8mNQZmy}Qi)ldU<5K>Qn6`pITfjY=-ObJy`4K+{)xeY9#3aX(7 z>L9n#B~(E*)Ic5Nen<&bPz^Ou2e}_tLKRd)4b(yS0(^UQ`m6EWKpo^Dlu!lLPy=<4 z15-j3R6`BaK@L_4RZtBzPzO1HB~(E*)Ic5Npq5Yt)ldU<5LSfkaa&TK{u(@Ykb_@B z6;wkF)In~Clu!lLPy=<4+esxJ- zgOGvkaeK&7aa+=z{_tUJ57MC;YM>6n3a~v$hia&SItVMp_8=Xqp$6(8d=a(>=}-+d zPzT}5@fApiYN&xa$UR=aeqFqI^QL(F_HFU*-Mixb`}f6%4$B*LY&!5GwU%yW4d$b3i0QLdDkd=5eZZZ=X zH{&KFAS-2lGj1{hvQp+Z<0c~@D`kE&ZZZP0Qsy_~CLTW{%~m9)C?r+UmUmN!+y8LrP)u9 z?QXw3bPMCw9(LO?HOFte-5nN&Zb{s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ZNSCXj600)RZ(#?1pJkZjxnfIQj8%>yQo3~v7i4ejZC literal 0 HcmV?d00001 diff --git a/SampleRevitAddin.Resources/Images/Icons/e-verselogo.ico b/SampleRevitAddin.Resources/Images/Icons/e-verselogo.ico new file mode 100644 index 0000000000000000000000000000000000000000..9eb2ce050e9f6b738cb5493dbf12afa8579bf9e6 GIT binary patch literal 50174 zcmeHQJCfTt6r{6FoNnL~OwRHNd;wp;DHC77C-4OvAzNR-7Z9s4K#oOEZ_iN zNewiB0W9DEtnHo+UJYOY2l&R+Km!=S0uJyEtbqnFfCU`j8(jkpU;qm^z!Rx~1~7mH z9N@{-Km!=S0uDe0sJ-c)2Co)yfES?#8o&S+aDW%41{%Ns7I1(Us|Fgt02Xk77qA8z zzyKC-fETp}8o&S+Z~zKIdwfew_q2F*fET|88o&S+aDX?Y1{%Ns7I1(!sRkOr02Xk7 zH?9U6zyKC-fH$)S8o&S+Z~zWKd%P;XCANDyyn54XpaBeE0SEYwPy-EM01G(4ca9op z00UUS0lvf3Km!=S0uI0n+Jp6g0W9DEY(RUwLtYi%64yPkGungofB`Jv02F}sU_D>} z3pfCUqCHp-7{CG!Kt*T|)&mBxfCErDs=#`{02Xk7f4qMEx_a~GP4)2bP`!QowtDyO zUG@I``|87o57ozyAFEHFK2@JTf3CiK`BHuT`nCG@?OV0m?W)7!Q2qGvqx$*tXZ8E{ z@1eY|&_pk%Kk89ce-xdQ@+sR-^+)}=rvlpF?x{AvF7=16**%X?f9|O^zb^HMuh~71 zP=D^JHoq?Qhp*W^k5GT^sW!hZ^@p$7J&#a-?x{AvF7=16**%X?f9|O^zb^HMuh~71 zP=5q!AI}fLk?cdV`*VCcJnr{x+wS*|ha6K4|P8?LIf9tbD+xXEMCE z2d?C-{d4j;3?xPi`<%TlAD`pnh{e?p?GsCK*3Q}Z9QRiYZWc2V%EgDGv)kn(l#37H zjyJ2#HHI?rSsXik&&w4GdH5XrW-q^IitQ|Xo&&wjv&_`vvhZ0r@r=#dvvN3g=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W0wXBE=XpV-EmzOZp!$In z;8R|ALsnAP4FNvuraF0CByVR2_!KyN=m8Yqlj4k#+$AcpX+8<&I?37WcFLzuKlLX= z_nH(b?{B9f^MIOS(|Hj0`Q}8x%qv##De`=}Vtyd|fIhE3Yvyky4j`(#1+TZu>u}_B zG{~pCGZ5L`f_zR%Zil2CP*fU3+}|n9AnIg_X-(k#gFR-yil0(&R#|P}7oEaTSGVF>s~p0aKQ8B zUzOeU?W(!KMJAtMd0X$Ge71Igu3!D3_1Su>`m?nIbp7fNt#gd~ z)(+71t3R|pTW?i=wswH7U;Ux=*?Oz`v$X?s{pt^`&(>QjeW(JefGVI0r~;~hDxeCe d0;+&2pbDr0s(>n>3aA3AfGVI0r~*YQ@INaREL8vi literal 0 HcmV?d00001 diff --git a/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj b/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj index cad3ea5..3c1d143 100644 --- a/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj +++ b/SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj @@ -53,5 +53,10 @@ Always + + + + + \ No newline at end of file diff --git a/SampleRevitAddin.sln b/SampleRevitAddin.sln index b60187e..0f0489d 100644 --- a/SampleRevitAddin.sln +++ b/SampleRevitAddin.sln @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.Installer" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.Resources", "SampleRevitAddin.Resources\SampleRevitAddin.Resources.csproj", "{87317C2B-AF3A-40AD-865C-093FBAA72440}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3C7DD4D2-E4F4-47CD-88E1-C48C77173C05}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU