|
| 1 | +name: Publish artifacts |
| 2 | +on: |
| 3 | + # Will only run when release is published. |
| 4 | + release: |
| 5 | + types: |
| 6 | + - created |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + publish-artifacts: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Check out code |
| 14 | + uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + - name: Set up JDK 11 for x64 |
| 19 | + uses: actions/setup-java@v4 |
| 20 | + with: |
| 21 | + java-version: '11' |
| 22 | + distribution: 'temurin' |
| 23 | + architecture: x64 |
| 24 | + cache: maven |
| 25 | + |
| 26 | + - name: Build with Maven |
| 27 | + run: mvn install package -DskipTests -Drat.ignoreErrors=true -Pbin-dist -Pbuild-shaded-jar -Djdk.version=11 -T1C |
| 28 | + |
| 29 | + - name: Determine version |
| 30 | + id: version |
| 31 | + run: | |
| 32 | + LAST_TAG=$(git describe --abbrev=0 --tags) |
| 33 | + if [ "$LAST_TAG" = $(git describe --tag) ]; then |
| 34 | + version="$LAST_TAG" |
| 35 | + else |
| 36 | + version="${LAST_TAG}-SNAPSHOT" |
| 37 | + fi |
| 38 | + echo "$version" |
| 39 | + echo version="$version" >> $GITHUB_OUTPUT |
| 40 | +
|
| 41 | + # - name: Collect distribution |
| 42 | + # run: | |
| 43 | + # cp -r pinot-distribution/target/apache-pinot-1.2.0-bin/apache-pinot-1.2.0-bin pinot-${{ steps.version.outputs.version }} |
| 44 | + # tar cvfz pinot-${{ steps.version.outputs.version }}.tar.gz pinot-${{ steps.version.outputs.version }} |
| 45 | + |
| 46 | + # - name: Upload Packages |
| 47 | + # uses: actions/upload-artifact@v4 |
| 48 | + # with: |
| 49 | + # name: Package |
| 50 | + # path: pinot-${{ steps.version.outputs.version }}.tar.gz |
| 51 | + |
| 52 | + - name: Login to Docker Hub |
| 53 | + uses: docker/login-action@v3 |
| 54 | + with: |
| 55 | + username: ${{ secrets.DOCKERHUB_PUBLISH_USER }} |
| 56 | + password: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} |
| 57 | + |
| 58 | + - name: Publish image artifact registries |
| 59 | + uses: docker/build-push-action@v5 |
| 60 | + with: |
| 61 | + context: . |
| 62 | + push: true |
| 63 | + file: docker/images/hypertrace/Dockerfile |
| 64 | + tags: hypertrace/hypertrace-pinot:${{ steps.version.outputs.version }} |
0 commit comments