Release #33
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: Release | |
| # Run workflow on commits to the `master` branch | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Env | |
| run: | | |
| echo "SONATYPE_USERNAME=${{ secrets.SONATYPE_USERNAME }}" >> $GITHUB_ENV | |
| echo "SONATYPE_PASSWORD=${{ secrets.SONATYPE_PASSWORD }}" >> $GITHUB_ENV | |
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
| echo "TEMPORARY_GCS_BUCKET=${{ secrets.TEMPORARY_GCS_BUCKET }}" >> $GITHUB_ENV | |
| - name: Install graphviz | |
| run: sudo apt-get install -y graphviz | |
| - name: Set up Zulu 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - uses: actions/checkout@v4 | |
| if: ${{ !github.event.repository.fork }} | |
| - name: Setup sbt launcher | |
| uses: sbt/setup-sbt@v1 | |
| - id: 'auth' | |
| uses: 'google-github-actions/auth@v1' | |
| with: | |
| credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}' | |
| cleanup_credentials: false | |
| # - name: Use gcloud CLI | |
| # run: gcloud info | |
| # - name: Run tests & Coverage Report | |
| # run: SL_SPARK_BIGQUERY_MATERIALIZATION_DATASET=SL_BQ_TEST_DS TEMPORARY_GCS_BUCKET=starlake-app SL_REMOTE_TEST=true sbt coverage test coverageReport | |
| - name: Release Spark 2/3 | |
| run: echo SBT_OPTS="-Xss4M -Xms1g -Xmx4g" SL_SPARK_BIGQUERY_MATERIALIZATION_DATASET=SL_BQ_TEST_DS TEMPORARY_GCS_BUCKET=${{ env.TEMPORARY_GCS_BUCKET }} GITHUB_TOKEN=${{ env.GITHUB_TOKEN }} SONATYPE_USERNAME=${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD=${{ secrets.SONATYPE_PASSWORD }} SL_REMOTE_TEST=true RELEASE_SONATYPE=true sbt 'release with-defaults' | |
| - name: trigger-starlake-api | |
| if: ${{ success() }} | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.STARLAKE_API_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: 'starlake-ai', | |
| repo: 'starlake-api', | |
| workflow_id: 'docker-hub-amd-arm.yml', | |
| ref: 'main'}) | |
| docker-hub: | |
| needs: release | |
| name: Release Docker Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| id: vcs | |
| uses: actions/checkout@v4 | |
| - name: Setup sbt launcher | |
| uses: sbt/setup-sbt@v1 | |
| - name: Env | |
| run: | | |
| cat .versions >> $GITHUB_ENV | |
| source .versions | |
| FIRST_LINE=$(head -n 1 version.sbt) | |
| SL_VERSION=$(echo "$FIRST_LINE" | sed -E 's/.*version := "([0-9]+\.[0-9]+\.?.*)"/\1/') | |
| echo "SL_VERSION=${SL_VERSION}" >> $GITHUB_ENV | |
| SL_MAJOR_MINOR_VERSION=$(echo "${SL_VERSION}" | cut -d'.' -f1-2) | |
| echo "SL_MAJOR_MINOR_VERSION=${SL_MAJOR_MINOR_VERSION}" >> $GITHUB_ENV | |
| SL_MAJOR_VERSION=$(echo "${SL_VERSION}" | cut -d'.' -f1) | |
| echo "SL_MAJOR_VERSION=${SL_MAJOR_VERSION}" >> $GITHUB_ENV | |
| REGISTRY_IMAGE=starlakeai/starlake | |
| echo "REGISTRY_IMAGE=${REGISTRY_IMAGE}" >> $GITHUB_ENV | |
| REGISTRY_IMAGE_LATEST=${REGISTRY_IMAGE}:${SL_VERSION:-latest} | |
| echo "REGISTRY_IMAGE_LATEST=${REGISTRY_IMAGE_LATEST}" >> $GITHUB_ENV | |
| echo "DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}" >> $GITHUB_ENV | |
| echo "DOCKERHUB_TOKEN=${{ secrets.DOCKERHUB_TOKEN }}" >> $GITHUB_ENV | |
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
| - name: Prepare | |
| run: | | |
| ./scripts/docker-prepare.sh | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| labels: | | |
| org.opencontainers.image.vendor=starlakeai | |
| org.opencontainers.image.licenses=Apache-2.0 | |
| org.opencontainers.image.title=starlakeai/starlake | |
| org.opencontainers.image.description="A declarative text based tool that enables analysts and engineers to extract, load, transform and orchestrate their data pipelines." | |
| org.opencontainers.image.url=https://starlake.ai | |
| # generate Docker tags based on the following events/attributes | |
| tags: | | |
| type=schedule | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| # type=sha | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ env.DOCKERHUB_USERNAME }} | |
| password: ${{ env.DOCKERHUB_TOKEN }} | |
| - name: Build and export to Docker | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: "./distrib/docker" | |
| pull: true | |
| load: true | |
| tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY_IMAGE_LATEST }},${{ env.REGISTRY_IMAGE }}:${{ env.SL_MAJOR_MINOR_VERSION }},"${{ env.REGISTRY_IMAGE }}:${{ env.SL_MAJOR_VERSION }}",${{ env.REGISTRY_IMAGE }}:latest | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| VCS_REF=${{ steps.vcs.outputs.commit }} | |
| SL_VERSION=${{ env.SL_VERSION }} | |
| - name: Inspect image | |
| run: | | |
| docker image inspect --format='{{json .Config.Labels}}' ${{ env.REGISTRY_IMAGE_LATEST }} | |
| - name: Test | |
| run: | | |
| docker run --rm ${{ env.REGISTRY_IMAGE_LATEST }} help | |
| - name: Push image | |
| if: github.event_name != 'pull_request' | |
| id: push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: "./distrib/docker" | |
| platforms: ${{ env.PLATFORMS }} | |
| pull: true | |
| push: true | |
| provenance: mode=max | |
| tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY_IMAGE_LATEST }},${{ env.REGISTRY_IMAGE }}:${{ env.SL_MAJOR_MINOR_VERSION }},"${{ env.REGISTRY_IMAGE }}:${{ env.SL_MAJOR_VERSION }}","${{ env.REGISTRY_IMAGE }}:latest" | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| VCS_REF=${{ steps.vcs.outputs.commit }} | |
| SL_VERSION=${{ env.SL_VERSION }} | |
| # - name: Generate artifact attestation | |
| # if: github.event_name != 'pull_request' | |
| # uses: actions/attest-build-provenance@v1 | |
| # with: | |
| # subject-name: ${{ env.REGISTRY_IMAGE }} | |
| # subject-digest: ${{ steps.push.outputs.digest }} | |
| # push-to-registry: true | |
| # github-token: ${{ env.GITHUB_TOKEN }} | |