diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30a8979..d951317 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,30 +6,38 @@ on: pull_request: branches: [ "main" ] +env: + HYPER_VERSION: "0.0.21200.re11c8cb9" + jobs: + download-hyperd: + uses: ./.github/workflows/hyperd.yml + with: + hyper_version: "0.0.21200.re11c8cb9" + build: runs-on: ubuntu-latest + strategy: + matrix: + java-version: [8, 11, 17, 21] + name: Build with JDK ${{ matrix.java-version }} steps: - uses: actions/checkout@v4 with: fetch-depth: 2 - - name: Set up JDK 8 + - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v4 with: - java-version: '8' + java-version: ${{ matrix.java-version }} distribution: 'temurin' - cache: maven - - name: Get hyperd version - id: evaluate-property - run: | - echo "HYPER_VERSION=$(mvn help:evaluate -Dexpression=hyperapi.version -q -DforceStdout)" >> $GITHUB_ENV - - name: Cache hyperd - uses: actions/cache@v3 +# cache: maven + - name: Maven clean + run: mvn --batch-mode clean + - name: Restore hyperd from cache + uses: actions/cache@v4 with: - path: | - target/.cache - key: ${{ runner.os }}-hyper-${{ env.HYPER_VERSION }} - restore-keys: | - ${{ runner.os }}-hyper-${{ env.HYPER_VERSION }} + path: target/hyper + fail-on-cache-miss: 'true' + key: hyperd-${{ runner.os }}-${{ env.HYPER_VERSION }} - name: Maven package - run: mvn --batch-mode --no-transfer-progress clean package --file pom.xml + run: mvn --batch-mode --no-transfer-progress package --file pom.xml -Dskip.hyper.download=true -X diff --git a/.github/workflows/hyperd.yml b/.github/workflows/hyperd.yml new file mode 100644 index 0000000..8d7f639 --- /dev/null +++ b/.github/workflows/hyperd.yml @@ -0,0 +1,38 @@ +on: + workflow_call: + inputs: + hyper_version: + required: true + type: string + +jobs: + download-hyperd: + runs-on: ubuntu-latest + steps: + - name: Cache hyperd + id: cache-hyperd + uses: actions/cache@v4 + with: + path: target/hyper + key: hyperd-${{ runner.os }}-${{ inputs.hyper_version }} + restore-keys: + hyperd-${{ runner.os }}- + + - name: Download hyperd if not cached + if: steps.cache-hyperd.outputs.cache-hit != 'true' + run: | + wget "https://downloads.tableau.com/tssoftware/tableauhyperapi-cxx-linux-x86_64-release-main.${{ inputs.hyper_version }}.zip" -O /tmp/hyperd.zip + + - name: Extract hyperd to target/hyper + if: steps.cache-hyperd.outputs.cache-hit != 'true' + run: | + mkdir -p target/hyper + unzip -j /tmp/hyperd.zip -d target/hyper "**/hyperd" "**/*.so" + + - name: Verify hyperd exists + run: | + ls -latrR + if [[ ! -f "target/hyper/hyperd" ]]; then + echo "ERROR: hyperd is missing!" + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8271986..5af0639 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,15 @@ on: release: types: [ "created" ] +env: + HYPER_VERSION: "0.0.21200.re11c8cb9" + jobs: + download-hyperd: + uses: ./.github/workflows/hyperd.yml + with: + hyper_version: ${{ env.HYPER_VERSION }} + build: runs-on: ubuntu-latest @@ -20,22 +28,16 @@ jobs: server-password: 'MAVEN_PASSWORD' gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} gpg-passphrase: 'MAVEN_GPG_PASSPHRASE' - - name: Get hyperd version - id: evaluate-property - run: | - echo "HYPER_VERSION=$(mvn help:evaluate -Dexpression=hyperapi.version -q -DforceStdout)" >> $GITHUB_ENV - - name: Cache hyperd - uses: actions/cache@v3 + - name: Restore hyperd from cache + uses: actions/cache@v4 with: - path: | - target/.cache - key: ${{ runner.os }}-hyper-${{ env.HYPER_VERSION }} - restore-keys: | - ${{ runner.os }}-hyper-${{ env.HYPER_VERSION }} + path: target/hyper + fail-on-cache-miss: 'true' + key: hyperd-${{ runner.os }}-${{ env.HYPER_VERSION }} - name: Set version run: mvn versions:set --no-transfer-progress -DnewVersion=${{ github.event.release.tag_name }} - name: Build with Maven - run: mvn --batch-mode --no-transfer-progress clean deploy -P release --file pom.xml + run: mvn --batch-mode --no-transfer-progress clean deploy -P release --file pom.xml -Dskip.hyper.download=true env: MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} diff --git a/pom.xml b/pom.xml index da1a545..186333e 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 0.13.0 33.2.1-jre - 0.0.20746.reac9bd2d + 0.0.21200.re11c8cb9 ${project.build.directory}/hyper 2.18.0 0.8.12 @@ -33,7 +33,9 @@ UTF-8 UTF-8 3.25.5 + false com.salesforce.datacloud.jdbc.internal.shaded + false 1.7.32 2.30.0 @@ -626,6 +628,7 @@ ${hyper-download-url}.${hyperapi.version}.zip true ${download.cache.directory}/hyper-unzipped + ${skip.hyper.download} @@ -654,6 +657,7 @@ + ${skip.hyper.download}