Skip to content

Commit c522c68

Browse files
Initial upload
0 parents  commit c522c68

39 files changed

+1652
-0
lines changed

.github/workflows/dev_actions.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#dev_actions.yml
2+
3+
name: Compile and run tests
4+
on:
5+
push:
6+
# this will cause the action to run on pushes to branches that start with the prefixes specified here
7+
branches: [ develop, tests/*, features/*, docs/*, bugs/* ]
8+
tags:
9+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10+
11+
pull_request:
12+
# we'll also run this when pull requests to develop are opened
13+
branches: [ develop ]
14+
15+
jobs:
16+
Build:
17+
# The type of runner that the job will run on
18+
runs-on: windows-latest
19+
env:
20+
Solution_Name: SampleRevitAddin.sln
21+
outputs:
22+
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
23+
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
with:
29+
fetch-depth: 0
30+
31+
# install and calculate the new version with GitVersion
32+
- name: Install GitVersion
33+
uses: gittools/actions/gitversion/setup@v0.9.7
34+
with:
35+
versionSpec: '5.5.0'
36+
37+
- name: Determine Version
38+
uses: gittools/actions/gitversion/execute@v0.9.7
39+
with:
40+
useConfigFile: true
41+
configFilePath: GitVersion.yml
42+
43+
id: gitversion # step id used as reference for output values
44+
- name: Display GitVersion outputs
45+
run: |
46+
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
47+
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
48+
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
49+
50+
51+
- name: Setup MSBuild.exe
52+
uses: microsoft/setup-msbuild@v1.0.2
53+
54+
- name: Setup NuGet
55+
uses: NuGet/setup-nuget@v1.0.5
56+
57+
- name: Restore nuGet packages
58+
run: nuget restore $env:Solution_Name
59+
60+
- name: Run MSBuild
61+
id: run-msbuild
62+
run: |
63+
msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release
64+
65+
- name: Run tests
66+
id: run-tests
67+
run: |
68+
dotnet test
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#production_actions.yml
2+
3+
name: Deploy to Production
4+
on:
5+
push:
6+
# this will cause the action to run on pushes to main
7+
branches: [ main ]
8+
tags:
9+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10+
11+
jobs:
12+
Build:
13+
# The type of runner that the job will run on
14+
runs-on: windows-latest
15+
env:
16+
Solution_Name: SampleRevitAddin.sln
17+
outputs:
18+
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
19+
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
# install and calculate the new version with GitVersion
28+
- name: Install GitVersion
29+
uses: gittools/actions/gitversion/setup@v0.9.7
30+
with:
31+
versionSpec: '5.5.0'
32+
33+
- name: Determine Version
34+
uses: gittools/actions/gitversion/execute@v0.9.7
35+
with:
36+
useConfigFile: true
37+
configFilePath: GitVersion.yml
38+
39+
id: gitversion # step id used as reference for output values
40+
- name: Display GitVersion outputs
41+
run: |
42+
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
43+
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
44+
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
45+
- name: Setup MSBuild.exe
46+
uses: microsoft/setup-msbuild@v1.0.2
47+
48+
- name: Setup NuGet
49+
uses: NuGet/setup-nuget@v1.0.5
50+
51+
- name: Restore nuGet packages
52+
run: nuget restore $env:Solution_Name
53+
54+
- name: Set path for candle and light
55+
run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
56+
shell: bash
57+
58+
- name: Run MSBuild
59+
id: run-msbuild
60+
run: |
61+
msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release
62+
63+
- name: Run tests
64+
id: run-tests
65+
run: |
66+
dotnet test
67+
68+
- name: Create Release
69+
id: create_release
70+
uses: actions/create-release@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
73+
with:
74+
tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }}
75+
release_name: Sample Revit Addin v${{ steps.gitversion.outputs.majorMinorPatch }}
76+
automatic_release_tag: "latest"
77+
draft: false
78+
prerelease: false
79+
- name: Upload Release Asset
80+
id: upload-release-asset
81+
uses: actions/upload-release-asset@v1
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
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
86+
asset_path: .\SampleRevitAddin.Installer\Output\SampleRevitAddin.exe
87+
asset_name: SampleRevitAddin.exe
88+
asset_content_type: application/zip

.github/workflows/staging_actions.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#staging_actions.yml
2+
3+
name: Deploy to Staging
4+
on:
5+
push:
6+
# this will cause the action to run on pushes to staging
7+
branches: [ staging ]
8+
tags:
9+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10+
11+
jobs:
12+
Build:
13+
# The type of runner that the job will run on
14+
runs-on: windows-latest
15+
env:
16+
Solution_Name: SampleRevitAddin.sln
17+
outputs:
18+
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
19+
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
# install and calculate the new version with GitVersion
28+
- name: Install GitVersion
29+
uses: gittools/actions/gitversion/setup@v0.9.7
30+
with:
31+
versionSpec: '5.5.0'
32+
33+
- name: Determine Version
34+
uses: gittools/actions/gitversion/execute@v0.9.7
35+
with:
36+
useConfigFile: true
37+
configFilePath: GitVersion.yml
38+
39+
id: gitversion # step id used as reference for output values
40+
- name: Display GitVersion outputs
41+
run: |
42+
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
43+
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
44+
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
45+
- name: Setup MSBuild.exe
46+
uses: microsoft/setup-msbuild@v1.0.2
47+
48+
- name: Setup NuGet
49+
uses: NuGet/setup-nuget@v1.0.5
50+
51+
- name: Restore nuGet packages
52+
run: nuget restore $env:Solution_Name
53+
54+
- name: Run MSBuild
55+
id: run-msbuild
56+
run: |
57+
msbuild $env:Solution_Name /t:Clean,Build /p:platform="Any CPU" /p:Configuration=Release
58+
59+
- name: Run tests
60+
id: run-tests
61+
run: |
62+
dotnet test
63+
64+
- name: Create Release
65+
id: create_release
66+
uses: actions/create-release@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
69+
with:
70+
tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }}-b
71+
release_name: Sample Revit Addin v${{ steps.gitversion.outputs.majorMinorPatch }}-beta
72+
automatic_release_tag: "latest"
73+
draft: false
74+
prerelease: true
75+
- name: Upload Release Asset
76+
id: upload-release-asset
77+
uses: actions/upload-release-asset@v1
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
with:
81+
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
82+
asset_path: .\SampleRevitAddin.Installer\Output\SampleRevitAddin.exe
83+
asset_name: SampleRevitAddin.exe
84+
asset_content_type: application/zip

0 commit comments

Comments
 (0)