Dagger Release #53
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: Dagger Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dagger_release_version: | |
| description: 'The Dagger version to use in this release.' | |
| required: true | |
| # Cancel in-progress jobs for the same workflow and branch except for the master branch. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| env: | |
| USE_AGP_VERSION: '9.0.0' | |
| USE_JAVA_DISTRIBUTION: 'zulu' | |
| USE_JAVA_VERSION_FOR_BAZEL: '21' | |
| USE_JAVA_VERSION_FOR_GRADLE: '21' | |
| DAGGER_RELEASE_VERSION: "${{ github.event.inputs.dagger_release_version }}" | |
| # The default Maven 3.9.0 has a regression so we manually install 3.8.7. | |
| # https://issues.apache.org/jira/browse/MNG-7679 | |
| USE_MAVEN_VERSION: '3.8.7' | |
| # TODO(bcorso):Convert these jobs into local composite actions to share with the | |
| # continuous integration workflow. | |
| jobs: | |
| validate-latest-dagger-version: | |
| name: 'Validate Dagger version' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/prechecks | |
| bazel-build: | |
| name: 'Bazel build' | |
| needs: validate-latest-dagger-version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/bazel-build | |
| bazel-test: | |
| name: 'Bazel tests' | |
| needs: validate-latest-dagger-version | |
| runs-on: | |
| group: large-runner-group | |
| labels: ubuntu-22.04-16core | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/bazel-test | |
| artifact-verification-tests: | |
| name: 'Artifact verification tests' | |
| needs: bazel-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/artifact-verification-tests | |
| artifact-java-local-tests: | |
| name: 'Artifact Java local tests' | |
| needs: bazel-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/artifact-java-local-tests | |
| test-gradle-plugin: | |
| name: 'Test Hilt Gradle plugin' | |
| needs: bazel-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/test-gradle-plugin | |
| artifact-android-local-tests: | |
| name: 'Artifact Android local tests' | |
| needs: bazel-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/artifact-android-local-tests | |
| publish-artifacts: | |
| name: 'Publish Artifact' | |
| needs: [ | |
| bazel-test, | |
| artifact-verification-tests, | |
| artifact-java-local-tests, | |
| artifact-android-local-tests, | |
| test-gradle-plugin | |
| ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: 'Install Java ${{ env.USE_JAVA_VERSION_FOR_BAZEL }}' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: '${{ env.USE_JAVA_DISTRIBUTION }}' | |
| java-version: '${{ env.USE_JAVA_VERSION_FOR_BAZEL }}' | |
| server-id: sonatype-central-staging | |
| server-username: CI_DEPLOY_USERNAME | |
| server-password: CI_DEPLOY_PASSWORD | |
| gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }} | |
| gpg-passphrase: CI_GPG_PASSPHRASE | |
| - name: 'Check out repository' | |
| uses: actions/checkout@v4 | |
| - name: 'Cache local Maven repository' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.m2/repository | |
| !~/.m2/repository/com/google/dagger | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: 'Cache Bazel files' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/bazel_github # The bazel cache path set in .bazelrc. | |
| key: ${{ runner.os }}-bazel-build-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-bazel-build- | |
| - name: 'Cache Gradle files' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Publish artifacts | |
| run: | | |
| util/deploy-all.sh \ | |
| "gpg:sign-and-deploy-file" \ | |
| "${{ env.DAGGER_RELEASE_VERSION }}" \ | |
| "-DrepositoryId=sonatype-central-staging" \ | |
| "-Durl=https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/" | |
| shell: bash | |
| env: | |
| CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | |
| CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} | |
| CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }} | |
| - name: 'Upload artifacts to Sonatype' | |
| run: util/upload-to-sonatype.sh | |
| shell: bash | |
| env: | |
| SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} | |
| - name: 'Set git credentials' | |
| run: | | |
| git config --global user.email "dagger-dev+github@google.com" | |
| git config --global user.name "Dagger Team" | |
| shell: bash | |
| - name: 'Publish tagged release' | |
| run: util/publish-tagged-release.sh ${{ env.DAGGER_RELEASE_VERSION }} | |
| shell: bash | |
| - name: 'Publish tagged docs' | |
| run: util/publish-tagged-docs.sh ${{ env.DAGGER_RELEASE_VERSION }} | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: 'Clean bazel cache' | |
| run: rm -rf $(bazel info repository_cache) | |
| shell: bash |