Skip to content

Commit d8dad1b

Browse files
committed
Enable SNAPSHOT version uploads on master
This adds a new github action that will build the jars and upload them to the maven central snapshot repo if the verison ends in -SNAPSHOT for any push or merge to master.
1 parent a17fd14 commit d8dad1b

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
prerelease: false
4040

4141
- name: Upload to maven
42+
secrets: inherit
4243
run: ./ci/upload_to_maven.sh
4344
shell: bash
4445
env:
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: TileDB-Cloud-Java
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- seth/eng-142-enable-snapshot-maven-central-uploads-for-tiledb-cloud-java
9+
10+
jobs:
11+
Snapshot:
12+
# if: github.ref == 'refs/heads/master'
13+
name: Create-Snapshot-Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Java
20+
uses: actions/setup-java@v2
21+
with:
22+
distribution: 'adopt'
23+
java-version: '11'
24+
check-latest: true
25+
26+
- name: Check version
27+
run: |
28+
VERSION=$(awk -F"'" '/^version = / {print $2}' build.gradle)
29+
if [[ "$VERSION" != *-SNAPSHOT ]]; then
30+
echo "Error: Version $VERSION in build.gradle does not end with -SNAPSHOT."
31+
exit 1
32+
fi
33+
echo "Version $VERSION is a snapshot version. Proceeding."
34+
35+
- name: Create-Jars
36+
run: unset SYSTEM; set +e; ./gradlew assemble; ./gradlew shadowJar; mkdir jars/; cp ./build/libs/*.jar jars/
37+
38+
- name: Upload to maven
39+
run: |
40+
chmod +x ./ci/upload_to_maven.sh
41+
./ci/upload_to_maven.sh
42+
shell: bash
43+
env:
44+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
45+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
46+
GPG_SECRET_KEYS_ENC: ${{ secrets.GPG_SECRET_KEYS_ENC }}
47+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
48+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

0 commit comments

Comments
 (0)