forked from opensearch-project/opensearch-protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 1.11 KB
/
Copy pathmaven-publish.yml
File metadata and controls
36 lines (32 loc) · 1.11 KB
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
name: Build and Publish Snapshots to Maven
on:
workflow_dispatch:
push:
branches:
- 'main'
jobs:
build-and-publish-snapshots:
runs-on: ubuntu-latest
if: github.repository == 'opensearch-project/opensearch-protobufs'
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
- name: Load secret
uses: 1password/load-secrets-action@v2
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
- name: publish snapshots to maven
run: |
./tools/java/package_proto_jar.sh -c true
./gradlew publishCreatePublicationToSnapshotsRepository