-
-
Notifications
You must be signed in to change notification settings - Fork 6
187 lines (157 loc) · 8.12 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# This is a basic workflow to help you get started with Actions
name: CI_RELEASE
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
release:
types:
- published
- edited
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build_maven_and_deploy:
# The type of runner that the job will run on
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
framework: [ 'net462', 'net6.0', 'net8.0' ]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework ${{ matrix.framework }} --configuration Release /p:Platform="Any CPU" src\net\JCOReflectorCLI.sln
# Runs a set of commands using the runners shell
- name: Copy configuration file
if: matrix.framework != 'net462'
run: Copy-Item .github\workflows\JCOReflectorCLI_${{ matrix.framework }}.runtimeconfig.json -Destination bin\${{ matrix.framework }}\MASES.JCOReflectorCLI.runtimeconfig.json -Force
- name: Build Maven POM files
run: .\bin\${{ matrix.framework }}\MASES.JCOReflectorCLI -JobType CreatePOM -POMStagingType Release -JobFile .github\workflows\createpom_win19.job
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: temurin
java-version: 11
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Install local file to be used within Javadoc section of generated POM
shell: bash
run: mvn install:install-file --no-transfer-progress -Dfile=../../../bin/${{ matrix.framework }}/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.13 -Dpackaging=jar -f ./src/jvm/src/${{ matrix.framework }}.xml
- name: Publish ${{ matrix.framework }} to Apache Maven Central
shell: bash
run: mvn --file ./src/jvm/src/${{ matrix.framework }}.xml --no-transfer-progress --batch-mode -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
build_release:
needs: [build_maven_and_deploy]
# The type of runner that the job will run on
runs-on: windows-2022
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: 'true'
# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\net\JCOReflectorCLI.sln
- uses: nuget/[email protected]
with:
nuget-version: '5.x'
- run: nuget pack src\net\CLI\JCOReflectorCLI.nuspec -OutputDirectory .\bin
# Runs a set of commands using the runners shell
- name: Copy configuration file
run: |
Copy-Item .github\workflows\JCOReflectorCLI_net6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
Copy-Item .github\workflows\JCOReflectorCLI_net8.0.runtimeconfig.json -Destination bin\net8.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
- name: Build Java files
run: |
.\bin\net6.0\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
.\bin\net8.0\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
.\bin\net462\MASES.JCOReflectorCLI -JobType Build -JobFile .github\workflows\build_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Build JAR files
run: |
.\bin\net6.0\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net6.0_win19.job -JDKFolder %JAVA_HOME_11_X64%
.\bin\net8.0\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net8.0_win19.job -JDKFolder %JAVA_HOME_11_X64%
.\bin\net462\MASES.JCOReflectorCLI -JobType CreateJars -JobFile .github\workflows\createjars_net462_win19.job -JDKFolder %JAVA_HOME_11_X64%
shell: cmd
- name: Compress release files
run: |
Compress-Archive -Path .\bin\net6.0\* -DestinationPath .\bin\net6.0.zip
Compress-Archive -Path .\bin\net8.0\* -DestinationPath .\bin\net8.0.zip
Compress-Archive -Path .\bin\net462\* -DestinationPath .\bin\net462.zip
- name: Compress documentation files
run: |
Compress-Archive -Path .\docs\net6.0\* -DestinationPath .\net6.0.docs.zip
Compress-Archive -Path .\docs\net8.0\* -DestinationPath .\net8.0.docs.zip
Compress-Archive -Path .\docs\net462\* -DestinationPath .\net462.docs.zip
- name: Upload net6.0 binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .\bin\net6.0.zip
asset_name: net6.0.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload net8.0 binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .\bin\net8.0.zip
asset_name: net8.0.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload net462 binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .\bin\net462.zip
asset_name: net462.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload net6.0 documentation to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .\net6.0.docs.zip
asset_name: net6.0.docs.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload net8.0 documentation to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .\net8.0.docs.zip
asset_name: net8.0.docs.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload net462 documentation to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .\net462.docs.zip
asset_name: net462.docs.zip
tag: ${{ github.ref }}
overwrite: true
- name: Publish to NuGet
run: |
nuget push .\bin\*.nupkg -ApiKey ${{ secrets.MASES_NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json -SkipDuplicate
nuget push .\bin\*.snupkg -ApiKey ${{ secrets.MASES_NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json -SkipDuplicate