release.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  2. # Copyright 2022 Apollo Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. # This workflow will build a Java project with Maven
  17. # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
  18. name: publish sdks
  19. on:
  20. workflow_dispatch:
  21. inputs:
  22. repository:
  23. description: 'Maven Repository(snapshots or releases)'
  24. required: true
  25. default: 'snapshots'
  26. jobs:
  27. publish:
  28. runs-on: ubuntu-latest
  29. steps:
  30. - uses: actions/checkout@v2
  31. - name: Set up Maven Central Repository
  32. uses: actions/setup-java@v1
  33. with:
  34. java-version: 8
  35. server-id: ${{ github.event.inputs.repository }}
  36. server-username: MAVEN_USERNAME
  37. server-password: MAVEN_CENTRAL_TOKEN
  38. gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
  39. gpg-passphrase: MAVEN_GPG_PASSPHRASE
  40. - name: Publish to Apache Maven Central
  41. run: mvn clean deploy -pl apollo-client,apollo-mockserver,apollo-openapi,apollo-client-config-data -am -DskipTests=true -Prelease "-Dreleases.repo=https://oss.sonatype.org/service/local/staging/deploy/maven2" "-Dsnapshots.repo=https://oss.sonatype.org/content/repositories/snapshots"
  42. env:
  43. MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
  44. MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
  45. MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}