-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c522c68
Showing
39 changed files
with
1,652 additions
and
0 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,68 @@ | ||
#dev_actions.yml | ||
|
||
name: Compile and run tests | ||
on: | ||
push: | ||
# this will cause the action to run on pushes to branches that start with the prefixes specified here | ||
branches: [ develop, tests/*, features/*, docs/*, bugs/* ] | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
pull_request: | ||
# we'll also run this when pull requests to develop are opened | ||
branches: [ develop ] | ||
|
||
jobs: | ||
Build: | ||
# The type of runner that the job will run on | ||
runs-on: windows-latest | ||
env: | ||
Solution_Name: SampleRevitAddin.sln | ||
outputs: | ||
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }} | ||
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# install and calculate the new version with GitVersion | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.5.0' | ||
|
||
- name: Determine Version | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
configFilePath: GitVersion.yml | ||
|
||
id: gitversion # step id used as reference for output values | ||
- name: Display GitVersion outputs | ||
run: | | ||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" | ||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | ||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- name: Restore nuGet packages | ||
run: nuget restore $env:Solution_Name | ||
|
||
- name: Run MSBuild | ||
id: run-msbuild | ||
run: | | ||
msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release | ||
- name: Run tests | ||
id: run-tests | ||
run: | | ||
dotnet test |
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,88 @@ | ||
#production_actions.yml | ||
|
||
name: Deploy to Production | ||
on: | ||
push: | ||
# this will cause the action to run on pushes to main | ||
branches: [ main ] | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
Build: | ||
# The type of runner that the job will run on | ||
runs-on: windows-latest | ||
env: | ||
Solution_Name: SampleRevitAddin.sln | ||
outputs: | ||
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }} | ||
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# install and calculate the new version with GitVersion | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.5.0' | ||
|
||
- name: Determine Version | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
configFilePath: GitVersion.yml | ||
|
||
id: gitversion # step id used as reference for output values | ||
- name: Display GitVersion outputs | ||
run: | | ||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" | ||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | ||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- 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 | ||
|
||
- name: Run MSBuild | ||
id: run-msbuild | ||
run: | | ||
msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release | ||
- name: Run tests | ||
id: run-tests | ||
run: | | ||
dotnet test | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }} | ||
release_name: Sample Revit Addin v${{ steps.gitversion.outputs.majorMinorPatch }} | ||
automatic_release_tag: "latest" | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
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: .\SampleRevitAddin.Installer\Output\SampleRevitAddin.exe | ||
asset_name: SampleRevitAddin.exe | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#staging_actions.yml | ||
|
||
name: Deploy to Staging | ||
on: | ||
push: | ||
# this will cause the action to run on pushes to staging | ||
branches: [ staging ] | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
Build: | ||
# The type of runner that the job will run on | ||
runs-on: windows-latest | ||
env: | ||
Solution_Name: SampleRevitAddin.sln | ||
outputs: | ||
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }} | ||
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# install and calculate the new version with GitVersion | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.5.0' | ||
|
||
- name: Determine Version | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
configFilePath: GitVersion.yml | ||
|
||
id: gitversion # step id used as reference for output values | ||
- name: Display GitVersion outputs | ||
run: | | ||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" | ||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | ||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- name: Restore nuGet packages | ||
run: nuget restore $env:Solution_Name | ||
|
||
- name: Run MSBuild | ||
id: run-msbuild | ||
run: | | ||
msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release | ||
- name: Run tests | ||
id: run-tests | ||
run: | | ||
dotnet test | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }}-b | ||
release_name: Sample Revit Addin v${{ steps.gitversion.outputs.majorMinorPatch }}-beta | ||
automatic_release_tag: "latest" | ||
draft: false | ||
prerelease: true | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
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: .\SampleRevitAddin.Installer\Output\SampleRevitAddin.exe | ||
asset_name: SampleRevitAddin.exe | ||
asset_content_type: application/zip |
Oops, something went wrong.