9
9
REPOSITORY_NAME:
10
10
required: true
11
11
type: string
12
- MORYX_OPTIMIZE_CODE:
13
- required: false
14
- type: string
15
- MORYX_BUILD_CONFIG:
16
- required: false
17
- type: string
18
- MORYX_BUILDNUMBER:
19
- required: false
20
- type: string
21
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE:
22
- required: false
23
- type: boolean
24
-
12
+
25
13
jobs:
26
14
Build:
27
- runs-on: windows -latest
15
+ runs-on: ubuntu -latest
28
16
steps:
29
17
- uses: actions/checkout@v2
30
-
31
- - name: Setup .NET SDK
32
- uses: actions/setup-dotnet@v1
33
- with:
34
- dotnet-version: ${{ inputs.dotnet_sdk_version }}
35
18
36
19
- name: Setup Node version
37
20
uses: actions/setup-node@v3
38
21
with:
39
22
node-version: 16
40
23
41
- - name: Build
42
- shell: pwsh
43
- env:
44
- MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}}
45
- MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}}
46
- MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}}
47
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}}
48
- run: ./Build.ps1 -Build -Pack
24
+ - name: Setup .NET SDK
25
+ uses: actions/setup-dotnet@v3
26
+ with:
27
+ dotnet-version: ${{ inputs.dotnet_sdk_version }}
28
+
29
+ - name: Clean
30
+ run: dotnet clean && dotnet nuget locals all --clear
31
+
32
+ - name: Execute dotnet restore
33
+ run: dotnet restore
49
34
35
+ - name: Execute dotnet build
36
+ if: ${{ !(startsWith(github.ref, 'refs/tags/v')) }}
37
+ run: |
38
+ ASSEMBLY_VERSION="$(cat VERSION)"
39
+ ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0
40
+ echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}"
41
+ FILE_VERSION="$(cat VERSION)"."${{github.run_number}}"
42
+ echo "FILE_VERSION = ${FILE_VERSION}"
43
+ INFORMATIONAL_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}"
44
+ echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}"
45
+ dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION
46
+
47
+
48
+ - name: Execute dotnet build (Release)
49
+ if: ${{ startsWith(github.ref, 'refs/tags/v') }}
50
+ run: |
51
+ ASSEMBLY_VERSION="${{github.ref_name}}"
52
+ ASSEMBLY_VERSION="${ASSEMBLY_VERSION#v}"
53
+ ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0
54
+ echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}"
55
+ FILE_VERSION="$(cat VERSION)"."${{github.run_number}}"
56
+ echo "FILE_VERSION = ${FILE_VERSION}"
57
+ INFORMATIONAL_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}"
58
+ echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}"
59
+ dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION
60
+
61
+
62
+ - name: Execute dotnet pack with release version
63
+ if: ${{ startsWith(github.ref, 'refs/tags/v') }}
64
+ run: |
65
+ RELEASE_VERSION="${{github.ref_name}}"
66
+ RELEASE_VERSION="${RELEASE_VERSION#v}"
67
+ echo "RELEASE_VERSION = ${RELEASE_VERSION}"
68
+ dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$RELEASE_VERSION
69
+
70
+
71
+ - name: Execute dotnet pack with production version (dev or future)
72
+ if: ${{ github.ref_name == 'dev' || github.ref_name == 'future'}}
73
+ run: |
74
+ PRODUCTION_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}"
75
+ echo "PRODUCTION_VERSION = ${PRODUCTION_VERSION}"
76
+ dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$PRODUCTION_VERSION
77
+
50
78
- name: Upload package artifacts
51
79
uses: actions/upload-artifact@v2
52
80
with:
53
- name: packages
54
- path: artifacts/Packages /
55
- retention-days: 1
81
+ name: ${{inputs.REPOSITORY_NAME}}- packages
82
+ path: artifacts/packages /
83
+ retention-days: 1
0 commit comments