Spice Java SDK v0.6.0 #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish (Maven Central) | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| environment: production | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: oracle | |
| java-version: 17 | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| cache: maven | |
| - name: Verify version consistency | |
| run: | | |
| POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| JAVA_VERSION=$(grep -oP 'SPICE_JAVA_VERSION = "\K[^"]+' src/main/java/ai/spice/Version.java) | |
| echo "pom.xml version: $POM_VERSION" | |
| echo "Version.java version: $JAVA_VERSION" | |
| if [ "$POM_VERSION" != "$JAVA_VERSION" ]; then | |
| echo "ERROR: Version mismatch between pom.xml ($POM_VERSION) and Version.java ($JAVA_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Build | |
| run: make build | |
| - name: Install Spice (https://install.spiceai.org) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl https://install.spiceai.org | /bin/bash | |
| echo "$HOME/.spice/bin" >> $GITHUB_PATH | |
| $HOME/.spice/bin/spice install | |
| - name: Init and start spice app | |
| run: | | |
| spice init spice_qs | |
| cd spice_qs | |
| spice add spiceai/quickstart | |
| spice run &> spice.log & | |
| # time to initialize added dataset | |
| sleep 10 | |
| - name: Run tests | |
| run: make test | |
| env: | |
| API_KEY: ${{ secrets.SPICE_CLOUD_QUICKSTART_API_KEY }} | |
| - name: Publish to Maven Central | |
| env: | |
| GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| run: make publish |