Skip to content

Commit

Permalink
Add publish workflow. (#7)
Browse files Browse the repository at this point in the history
Partial #2
  • Loading branch information
devinrsmith authored Feb 5, 2022
1 parent 8e11635 commit 1c525f3
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/env/Linux/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
# we shouldn't rely on gradle for any of this logic.
org.gradle.java.installations.auto-download=false
org.gradle.java.installations.auto-detect=false

# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# GitHub hosted linux runner environment has 2 CPUs and 7G RAM.
#
# Turning off parallelism makes things a bit more deterministic, and is specifically neded for publishing
# (to ensure we don't create disjointed staging repositories).

org.gradle.parallel=false
org.gradle.workers.max=1
org.gradle.jvmargs=-Xmx6g
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
branches: [ 'main', 'release/v*' ]

jobs:
check:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish CI

on:
push:
branches: [ 'release/v*' ]

# Ensure only one publish at any given time
concurrency: publish

jobs:
check:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Check gitignore rules
run: .github/scripts/check-gitignore-rules.sh

- name: Setup JDK
id: setup-java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'

- name: Setup gradle properties
run: |
cat .github/env/${{ runner.os }}/gradle.properties >> gradle.properties
echo >> gradle.properties
echo "org.gradle.java.installations.paths=${{ steps.setup-java.outputs.path }}" >> gradle.properties
cat gradle.properties
- name: Publish
# Note: even though we specify org.gradle.parallel=false in our CI gradle.properties, we want to be explicit
# here about no parallelism to ensure we don't create disjointed staging repositories.
run: ./gradlew --no-parallel publish
env:
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.CI_AT_DEEPHAVEN_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.CI_AT_DEEPHAVEN_PASSWORD }}

0 comments on commit 1c525f3

Please sign in to comment.