@@ -70,126 +70,133 @@ jobs:
70
70
working-directory : bindings/java
71
71
run : mvn clean verify
72
72
73
- # stage-snapshot:
74
- # runs-on: ${{ matrix.os }}
75
- # if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
76
- # strategy:
77
- # matrix:
78
- # include:
79
- # - os: ubuntu-latest
80
- # classifier: linux-x86_64
81
- # - os: windows-latest
82
- # classifier: windows-x86_64
83
- # - os: macos-latest
84
- # classifier: osx-x86_64
85
- # - os: macos-latest
86
- # classifier: osx-aarch_64
87
- # steps:
88
- # - uses: actions/checkout@v3
89
-
90
- # - name: Load secret
91
- # id: op-load-secret
92
- # uses: 1password/load-secrets-action@v1
93
- # with:
94
- # export-env: true
95
- # env:
96
- # OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
97
- # MAVEN_GPG_PRIVATE_KEY: op://services/maven/gpg_private_key
98
- # MAVEN_GPG_PASSPHRASE: op://services/maven/gpg_passphrase
99
-
100
- # - name: Set up JDK 8
101
- # uses: actions/setup-java@v3
102
- # with:
103
- # distribution: 'temurin'
104
- # java-version: '8'
105
- # cache: 'maven'
106
- # gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
107
- # gpg-passphrase: ${{ env.MAVEN_GPG_PASSPHRASE }}
108
- # - uses: actions/setup-python@v4
109
- # with:
110
- # python-version: '3.10'
111
-
112
- # - name: Local staging
113
- # working-directory: bindings/java
114
- # run: mvn -Papache-release package verify org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DjniClassifier=${{ matrix.classifier }} -DskipTests=true -DaltStagingDirectory=local-staging -DskipRemoteStaging=true
115
- # env:
116
- # MAVEN_GPG_PASSPHRASE: ${{ env.MAVEN_GPG_PASSPHRASE }}
117
- # - name: Upload local staging directory
118
- # uses: actions/upload-artifact@v3
119
- # with:
120
- # name: ${{ matrix.classifier }}-local-staging
121
- # path: bindings/java/local-staging
122
- # if-no-files-found: error
123
-
124
- # deploy-snapshots:
125
- # runs-on: ubuntu-latest
126
- # if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
127
- # needs: [stage-snapshot]
128
- # steps:
129
- # - uses: actions/checkout@v3
130
- # - name: Load secret
131
- # id: op-load-secret
132
- # uses: 1password/load-secrets-action@v1
133
- # with:
134
- # export-env: true
135
- # env:
136
- # OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
137
- # MAVEN_GPG_PRIVATE_KEY: op://services/maven/gpg_private_key
138
- # MAVEN_GPG_PASSPHRASE: op://services/maven/gpg_passphrase
139
-
140
- # - name: Set up JDK 8
141
- # uses: actions/setup-java@v3
142
- # with:
143
- # distribution: 'temurin'
144
- # java-version: '8'
145
- # cache: 'maven'
146
- # server-id: apache.snapshots.https
147
- # server-username: MAVEN_USERNAME
148
- # server-password: MAVEN_CENTRAL_TOKEN
149
- # gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
150
- # gpg-passphrase: ${{ env.MAVEN_GPG_PASSPHRASE }}
151
-
152
- # - name: Prepare enviroment variables
153
- # run: echo "LOCAL_STAGING_DIR=$HOME/local-staging" >> $GITHUB_ENV
154
-
155
- # - name: Download windows staging directory
156
- # uses: actions/download-artifact@v3
157
- # with:
158
- # name: windows-x86_64-local-staging
159
- # path: ~/windows-x86_64-local-staging
160
- # - name: Download linux staging directory
161
- # uses: actions/download-artifact@v3
162
- # with:
163
- # name: linux-x86_64-local-staging
164
- # path: ~/linux-x86_64-local-staging
165
- # - name: Download darwin staging directory
166
- # uses: actions/download-artifact@v3
167
- # with:
168
- # name: osx-x86_64-local-staging
169
- # path: ~/osx-x86_64-local-staging
170
- # - name: Download darwin (aarch64) staging directory
171
- # uses: actions/download-artifact@v3
172
- # with:
173
- # name: osx-aarch_64-local-staging
174
- # path: ~/osx-aarch_64-local-staging
175
-
176
- # - name: Merge staging repositories
177
- # run: |
178
- # mkdir -p ~/local-staging/deferred
179
- # cat ~/windows-x86_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
180
- # cp -r ~/windows-x86_64-local-staging/deferred/* ~/local-staging/deferred/
181
- # cat ~/linux-x86_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
182
- # cp -r ~/linux-x86_64-local-staging/deferred/* ~/local-staging/deferred/
183
- # cat ~/osx-x86_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
184
- # cp -r ~/osx-x86_64-local-staging/deferred/* ~/local-staging/deferred/
185
- # cat ~/osx-aarch_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
186
- # cp -r ~/osx-aarch_64-local-staging/deferred/* ~/local-staging/deferred/
187
-
188
- # - name: Deploy local staged artifacts
189
- # if: ${{ github.event_name != 'pull_request' }}
190
- # working-directory: bindings/java
191
- # run: mvn org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR
192
- # env:
193
- # MAVEN_USERNAME: ${{ secrets.NEXUS_USER }}
194
- # MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PW }}
195
- # MAVEN_GPG_PASSPHRASE: ${{ env.MAVEN_GPG_PASSPHRASE }}
73
+ stage-snapshot :
74
+ runs-on : ${{ matrix.os }}
75
+ if : ${{ github.event_name == 'push' || !github.event.pull_request.head.repo.fork }}}
76
+ strategy :
77
+ matrix :
78
+ include :
79
+ - os : ubuntu-latest
80
+ classifier : linux-x86_64
81
+ # FIXME: Windows is not supported due to 1password action limitation.
82
+ # - os: windows-latest
83
+ # classifier: windows-x86_64
84
+ - os : macos-latest
85
+ classifier : osx-x86_64
86
+ - os : macos-latest
87
+ classifier : osx-aarch_64
88
+ steps :
89
+ - uses : actions/checkout@v3
90
+ - uses : actions/setup-python@v4
91
+ with :
92
+ python-version : ' 3.10'
93
+
94
+ - name : Load secret
95
+ id : op-load-secret
96
+ uses : 1password/load-secrets-action@v1
97
+ with :
98
+ export-env : true
99
+ env :
100
+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
101
+ MAVEN_GPG_PRIVATE_KEY : op://services/maven/gpg_private_key
102
+ MAVEN_GPG_PASSPHRASE : op://services/maven/gpg_passphrase
103
+
104
+ - name : Set up JDK 8
105
+ uses : actions/setup-java@v3
106
+ with :
107
+ distribution : ' temurin'
108
+ java-version : ' 8'
109
+ cache : ' maven'
110
+ gpg-private-key : ${{ env.MAVEN_GPG_PRIVATE_KEY }}
111
+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
112
+
113
+ - name : Local staging
114
+ working-directory : bindings/java
115
+ run : mvn -Papache-release package verify org.sonatype.plugins:nexus-staging-maven-plugin:deploy -Dsuffix.snapshot="-SNAPSHOT" -Djni.classifier=${{ matrix.classifier }} -DskipTests=true -DaltStagingDirectory=local-staging -DskipRemoteStaging=true
116
+ env :
117
+ MAVEN_GPG_PASSPHRASE : ${{ env.MAVEN_GPG_PASSPHRASE }}
118
+
119
+ - name : Upload local staging directory
120
+ uses : actions/upload-artifact@v3
121
+ with :
122
+ name : ${{ matrix.classifier }}-local-staging
123
+ path : bindings/java/local-staging
124
+ if-no-files-found : error
125
+
126
+ deploy-snapshots :
127
+ runs-on : ubuntu-latest
128
+ if : ${{ github.event_name == 'push' || !github.event.pull_request.head.repo.fork }}}
129
+ needs : [stage-snapshot]
130
+ steps :
131
+ - uses : actions/checkout@v3
132
+ - name : Load secret
133
+ id : op-load-secret
134
+ uses : 1password/load-secrets-action@v1
135
+ with :
136
+ export-env : true
137
+ env :
138
+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
139
+ MAVEN_GPG_PRIVATE_KEY : op://services/maven/gpg_private_key
140
+ MAVEN_GPG_PASSPHRASE : op://services/maven/gpg_passphrase
141
+
142
+ - name : Set up JDK 8
143
+ uses : actions/setup-java@v3
144
+ with :
145
+ distribution : ' temurin'
146
+ java-version : ' 8'
147
+ cache : ' maven'
148
+ server-id : apache.snapshots.https
149
+ server-username : MAVEN_USERNAME
150
+ server-password : MAVEN_CENTRAL_TOKEN
151
+ gpg-private-key : ${{ env.MAVEN_GPG_PRIVATE_KEY }}
152
+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
153
+
154
+ - name : Prepare enviroment variables
155
+ run : echo "LOCAL_STAGING_DIR=$HOME/local-staging" >> $GITHUB_ENV
156
+
157
+ # - name: Download windows staging directory
158
+ # uses: actions/download-artifact@v3
159
+ # with:
160
+ # name: windows-x86_64-local-staging
161
+ # path: ~/windows-x86_64-local-staging
162
+
163
+ - name : Download linux staging directory
164
+ uses : actions/download-artifact@v3
165
+ with :
166
+ name : linux-x86_64-local-staging
167
+ path : ~/linux-x86_64-local-staging
168
+ - name : Download darwin staging directory
169
+ uses : actions/download-artifact@v3
170
+ with :
171
+ name : osx-x86_64-local-staging
172
+ path : ~/osx-x86_64-local-staging
173
+ - name : Download darwin (aarch64) staging directory
174
+ uses : actions/download-artifact@v3
175
+ with :
176
+ name : osx-aarch_64-local-staging
177
+ path : ~/osx-aarch_64-local-staging
178
+
179
+ - name : Merge staging repositories
180
+ run : |
181
+ mkdir -p ~/local-staging/deferred
182
+
183
+ # cat ~/windows-x86_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
184
+ # cp -r ~/windows-x86_64-local-staging/deferred/* ~/local-staging/deferred/
185
+
186
+ cat ~/linux-x86_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
187
+ cp -r ~/linux-x86_64-local-staging/deferred/* ~/local-staging/deferred/
188
+
189
+ cat ~/osx-x86_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
190
+ cp -r ~/osx-x86_64-local-staging/deferred/* ~/local-staging/deferred/
191
+
192
+ cat ~/osx-aarch_64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
193
+ cp -r ~/osx-aarch_64-local-staging/deferred/* ~/local-staging/deferred/
194
+
195
+ - name : Deploy local staged artifacts
196
+ if : ${{ github.event_name != 'pull_request' }}
197
+ working-directory : bindings/java
198
+ run : mvn org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -Dsuffix.snapshot="-SNAPSHOT" -DaltStagingDirectory=$LOCAL_STAGING_DIR
199
+ env :
200
+ MAVEN_USERNAME : ${{ secrets.NEXUS_USER }}
201
+ MAVEN_CENTRAL_TOKEN : ${{ secrets.NEXUS_PW }}
202
+ MAVEN_GPG_PASSPHRASE : ${{ env.MAVEN_GPG_PASSPHRASE }}
0 commit comments