1
+ # This workflow will build a .NET project
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3
+
4
+ name : ' Main Workflow'
5
+ run-name : ${{ github.event.repository.name }}_${{ github.run_number }}
6
+ permissions :
7
+ contents : read
8
+ issues : read
9
+ checks : write
10
+ pull-requests : write
11
+ on :
12
+ workflow_dispatch :
13
+
14
+ env :
15
+ solutionPath : ' ${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.sln'
16
+ solutionFolder : ' ${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool'
17
+ toolpublishlocation : ' ${{ github.workspace }/configurationmigrationtool'
18
+ datapublishlocation : ' ${{ github.workspace }/data'
19
+ jobs :
20
+ build :
21
+
22
+ runs-on : ubuntu-latest
23
+
24
+ steps :
25
+ - uses : actions/checkout@v3
26
+ with :
27
+ fetch-depth : 0
28
+ - name : Setup .NET
29
+ uses : actions/setup-dotnet@v3
30
+ with :
31
+ dotnet-version : 8.0.x
32
+
33
+ - name : Restore dependencies
34
+ run : dotnet restore ${{ env.solutionPath }}
35
+ - name : Build
36
+ run : dotnet build ${{ env.solutionPath }} --configuration Release --no-restore
37
+ - name : dotnet publish
38
+ if : ${{ (github.ref == 'refs/heads/main' || contains(github.ref, 'release')) && github.event_name != 'pull_request' }}
39
+ run : dotnet publish ${{ env.solutionFolder }}/Dataverse.ConfigurationMigrationTool.Console/Dataverse.ConfigurationMigrationTool.Console.csproj -c Release -o ${{env.toolpublishlocation}}
40
+ - name : Upload tool artifact
41
+ if : ${{ (github.ref == 'refs/heads/main' || contains(github.ref, 'release')) && github.event_name != 'pull_request' }}
42
+ uses : actions/upload-artifact@v3
43
+ with :
44
+ name : configurationmigrationtool
45
+ path : ${{env.toolpublishlocation}}
46
+ - name : Upload data artifact
47
+ if : ${{ (github.ref == 'refs/heads/main' || contains(github.ref, 'release')) && github.event_name != 'pull_request' }}
48
+ uses : actions/upload-artifact@v3
49
+ with :
50
+ name : data
51
+ path : ${{env.datapublishlocation}}
52
+
53
+ deployStaging :
54
+ name : ' staging'
55
+ needs : build
56
+ uses : ./.github/workflows/cd-pipeline.yml
57
+ if : ${{ (github.ref == 'refs/heads/main' || contains(github.ref, 'release')) && github.event_name != 'pull_request' }}
58
+ with :
59
+ environment : ' staging'
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
0 commit comments