18
18
uses : actions/setup-dotnet@v4
19
19
with :
20
20
dotnet-version : ' 8.0.x'
21
+
22
+ - name : Install CycloneDX
23
+ run : dotnet tool install --global CycloneDX
24
+ shell : bash
25
+
26
+ - name : Generate SBOM
27
+ run : dotnet-CycloneDX WindowsServiceDotNETCore.csproj --output . --output-format json
28
+ shell : bash
29
+
30
+ - name : Set Version
31
+ if : ${{ steps.branch-name.outputs.current_branch == 'main' }}
32
+ run : echo "PACKAGE_VERSION=$(date +'%Y%m%d').${{ github.run_number }}.${{ github.run_attempt }}" >> $GITHUB_ENV
33
+ shell : bash
34
+
35
+ - name : Configure maven-repository-aws-s3
36
+ run : |
37
+ cat <<EOT > ~/.m2/settings.xml
38
+ <settings>
39
+ <servers>
40
+ <server>
41
+ <id>octopus-sales-public-snapshot</id>
42
+ <username>${{ inputs.aws_access_key }}</username>
43
+ <password>${{ inputs.aws_secret_access_key }}</password>
44
+ <configuration>
45
+ <region>ap-southeast-2</region>
46
+ <publicRepository>true</publicRepository>
47
+ </configuration>
48
+ </server>
49
+ <server>
50
+ <id>octopus-sales-public-release</id>
51
+ <username>${{ inputs.aws_access_key }}</username>
52
+ <password>${{ inputs.aws_secret_access_key }}</password>
53
+ <configuration>
54
+ <region>ap-southeast-2</region>
55
+ <publicRepository>true</publicRepository>
56
+ </configuration>
57
+ </server>
58
+ </servers>
59
+ </settings>
60
+ EOT
61
+ shell : bash
62
+ working-directory : java
21
63
22
64
- name : Restore dependencies
23
65
run : dotnet restore
27
69
28
70
- name : Publish
29
71
run : dotnet publish --configuration Release --output ./publish
30
-
31
- - name : Upload artifact
32
- uses : actions/upload-artifact@v4
33
- with :
34
- name : published-app
35
- path : ./publish
72
+
73
+ - name : Build and push static web package
74
+ run : |
75
+ pushd publish
76
+ zip -r ../windowsservice.${{ env.PACKAGE_VERSION }}.zip .
77
+ popd
78
+
79
+ mvn deploy:deploy-file \
80
+ --batch-mode \
81
+ "-DgroupId=com.octopus" \
82
+ "-DartifactId=windowsservice" \
83
+ "-Dversion=${{ env.PACKAGE_VERSION }}" \
84
+ "-Dpackaging=zip" \
85
+ "-Dfile=windowsservice.${{ env.PACKAGE_VERSION }}.zip" \
86
+ "-DrepositoryId=octopus-sales-public-snapshot" \
87
+ "-Durl=s3://octopus-sales-public-maven-repo/snapshot"
88
+ shell : bash
0 commit comments