Skip to content

Commit dfcd9db

Browse files
authored
Merge pull request #12 from MORYX-Industry/fix/pipeline
Combine build and publish step
2 parents f958658 + bfd3d90 commit dfcd9db

File tree

2 files changed

+45
-49
lines changed

2 files changed

+45
-49
lines changed

.github/workflows/.build-and-publish.yml

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -53,49 +53,61 @@ jobs:
5353
myget_pass: ${{ secrets.MYGET_PASS }}
5454

5555

56-
Build:
56+
Build-Publish:
5757
needs: [Variables, Tests]
58-
uses: moryx-industry/tools/.github/workflows/build.yml@v1
59-
with:
60-
dotnet_sdk_version: ${{ needs.Variables.outputs.dotnet_sdk_version }}
61-
NPM_PACKAGE_SOURCE: ${{ needs.Variables.outputs.NPM_PACKAGE_SOURCE }}
62-
secrets:
63-
npm_auth_token: ${{ secrets.MYGET_TOKEN }}
64-
myget_auth_token: ${{ secrets.MYGET_TOKEN }}
65-
myget_user: ${{ secrets.MYGET_USER }}
66-
myget_pass: ${{ secrets.MYGET_PASS }}
67-
68-
Licensing:
69-
needs: [Build]
7058
runs-on: ubuntu-latest
59+
env:
60+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
61+
MORYX_COMMERCIAL_BUILD: true
7162
steps:
7263
- uses: actions/checkout@v4
7364

74-
- name: ⬇️ Download build artifacts
75-
uses: actions/download-artifact@v4
65+
- uses: actions/cache@v4
66+
id: cache-nuget
7667
with:
77-
name: build
78-
path: artifacts/build/
79-
80-
- name: Move artifacts
81-
run: mv artifacts/build artifacts/Licensing
82-
83-
- name: Zip artifacts
84-
uses: vimtor/[email protected]
68+
path: ${{ github.workspace }}/.nuget/packages
69+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
70+
restore-keys: |
71+
${{ runner.os }}-nuget-
72+
73+
- name: 🔧 Setup .NET SDK
74+
uses: actions/setup-dotnet@v4
8575
with:
86-
files: artifacts/Licensing/
87-
dest: licensing.zip
76+
dotnet-version: ${{ needs.Variables.outputs.dotnet_sdk_version }}
77+
78+
- name: ♺ Execute nuget restore
79+
run: nuget restore
80+
if: steps.cache-nuget.outputs.cache-hit != 'true'
81+
82+
- name: 🧰 Setup BuildToolkit
83+
uses: moryx-industry/setup-buildtoolkit@v1
84+
85+
- name: 🔨 Execute dotnet build
86+
run: |
87+
.\set-version.ps1 -RefName ${{ github.ref_name }} -IsTag ${{ github.ref_type == 'tag' && 1 || 0 }} -BuildNumber ${{ github.run_number }} -CommitHash ${{ github.sha }}
88+
.\build.ps1 -PackageSource ${{ github.workspace }}/.nuget/packages
89+
shell: pwsh
8890

89-
- name: 📦 Upload licensing artifacts
91+
- name: Copy artifacts
92+
run: cp -r artifacts/build artifacts/Licensing
93+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
94+
95+
- name: 📦 Create Packages and 🚚 deliver
96+
run: |
97+
.\set-version.ps1 -RefName ${{ github.ref_name }} -IsTag ${{ github.ref_type == 'tag' && 1 || 0 }} -BuildNumber ${{ github.run_number }} -CommitHash ${{ github.sha }}
98+
.\pack-publish.ps1 -NugetApiKey ${{ secrets.MYGET_TOKEN }} -PackageTarget ${{ needs.Variables.outputs.MORYX_PACKAGE_TARGET }}
99+
shell: pwsh
100+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
101+
102+
- name: ⬆️ Upload build artifacts
90103
uses: actions/upload-artifact@v4
91104
with:
92-
name: licensing
93-
path: licensing.zip
94-
retention-days: 1
95-
if-no-files-found: error
105+
name: packages
106+
path: artifacts/packages/
107+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
96108

97109
Create-Reports:
98-
needs: [Licensing]
110+
needs: [Build-Publish]
99111
uses: moryx-industry/tools/.github/workflows/create-test-report.yml@v1
100112
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
101113

@@ -104,21 +116,5 @@ jobs:
104116
uses: moryx-industry/tools/.github/workflows/publish-test-coverage.yml@v1
105117
secrets:
106118
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
107-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
108-
109-
Publish-Packages:
110-
needs: [Variables, Licensing]
111-
uses: moryx-industry/tools/.github/workflows/publish-packages.yml@v1
112-
with:
113-
dotnet_sdk_version: ${{ needs.Variables.outputs.dotnet_sdk_version }}
114-
npm_package_source: ${{ needs.Variables.outputs.NPM_PACKAGE_SOURCE }}
115-
nuget_package_target: ${{ needs.Variables.outputs.MORYX_PACKAGE_TARGET }}
116-
nuget_package_target_v3: ${{ needs.Variables.outputs.MORYX_PACKAGE_TARGET_V3 }}
117-
secrets:
118-
npm_auth_token: ${{ secrets.MYGET_TOKEN }}
119-
myget_auth_token: ${{ secrets.MYGET_TOKEN }}
120-
myget_user: ${{ secrets.MYGET_USER }}
121-
myget_pass: ${{ secrets.MYGET_PASS }}
122-
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
123-
119+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
124120

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.3
1+
0.2.0

0 commit comments

Comments
 (0)