Skip to content

Commit 6d6bc14

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 6d6bc14

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
secrets: inherit
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Java
21+
uses: actions/setup-java@v2
22+
with:
23+
distribution: 'adopt'
24+
java-version: '11'
25+
check-latest: true
26+
27+
- name: Check version
28+
run: |
29+
VERSION=$(awk -F"'" '/^version = / {print $2}' build.gradle)
30+
if [[ "$VERSION" != *-SNAPSHOT ]]; then
31+
echo "Error: Version $VERSION in build.gradle does not end with -SNAPSHOT."
32+
exit 1
33+
fi
34+
echo "Version $VERSION is a snapshot version. Proceeding."
35+
36+
- name: Create-Jars
37+
run: unset SYSTEM; set +e; ./gradlew assemble; ./gradlew shadowJar; mkdir jars/; cp ./build/libs/*.jar jars/
38+
39+
- name: Upload to maven
40+
run: |
41+
chmod +x ./ci/upload_to_maven.sh
42+
./ci/upload_to_maven.sh
43+
shell: bash
44+
env:
45+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
46+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
47+
GPG_SECRET_KEYS_ENC: ${{ secrets.GPG_SECRET_KEYS_ENC }}
48+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
49+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

0 commit comments

Comments
 (0)