|
| 1 | +name: Publishing for Spine v1.x |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - v1 |
| 7 | + - 1.x-dev |
| 8 | + |
| 9 | +jobs: |
| 10 | + publish: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v3 |
| 14 | + with: |
| 15 | + submodules: 'true' |
| 16 | + |
| 17 | + - uses: actions/setup-java@v3 |
| 18 | + with: |
| 19 | + java-version: 11 |
| 20 | + distribution: zulu |
| 21 | + cache: gradle |
| 22 | + |
| 23 | + - name: Decrypt CloudRepo credentials |
| 24 | + run: ./config/scripts/decrypt.sh "$CLOUDREPO_CREDENTIALS_KEY" ./.github/keys/cloudrepo.properties.gpg ./cloudrepo.properties |
| 25 | + env: |
| 26 | + CLOUDREPO_CREDENTIALS_KEY: ${{ secrets.CLOUDREPO_CREDENTIALS_KEY }} |
| 27 | + |
| 28 | + - name: Decrypt Git SSH credentials |
| 29 | + run: ./config/scripts/decrypt.sh "$GIT_CREDENTIALS_KEY" ./.github/keys/deploy_key_rsa.gpg ./deploy_key_rsa |
| 30 | + env: |
| 31 | + GIT_CREDENTIALS_KEY: ${{ secrets.GIT_CREDENTIALS_KEY }} |
| 32 | + |
| 33 | + # Make sure the SSH key is not "too visible". SSH agent will not accept it otherwise. |
| 34 | + - name: Set file system permissions |
| 35 | + run: chmod 400 ./deploy_key_rsa && chmod +x ./config/scripts/register-ssh-key.sh |
| 36 | + |
| 37 | + - name: Decrypt GCS credentials |
| 38 | + run: ./config/scripts/decrypt.sh "$GCS_CREDENTIALS_KEY" ./.github/keys/gcs-auth-key.json.gpg ./gcs-auth-key.json |
| 39 | + env: |
| 40 | + GCS_CREDENTIALS_KEY: ${{ secrets.GCS_CREDENTIALS_KEY }} |
| 41 | + |
| 42 | + - name: Decrypt GCAR credentials |
| 43 | + run: ./config/scripts/decrypt.sh "$MAVEN_PUBLISHER_KEY" ./.github/keys/maven-publisher.json.gpg ./maven-publisher.json |
| 44 | + env: |
| 45 | + MAVEN_PUBLISHER_KEY: ${{ secrets.MAVEN_PUBLISHER_KEY }} |
| 46 | + |
| 47 | + - name: Decrypt Git SSH credentials |
| 48 | + run: ./config/scripts/decrypt.sh "$GRADLE_PORTAL_CREDENTIALS_KEY" ./.github/keys/gradle-plugin-portal.secret.properties.gpg ./gradle-plugin-portal.secret.properties |
| 49 | + env: |
| 50 | + GRADLE_PORTAL_CREDENTIALS_KEY: ${{ secrets.GRADLE_PORTAL_CREDENTIALS_KEY }} |
| 51 | + |
| 52 | + - name: Append Gradle properties |
| 53 | + run: cat ./gradle-plugin-portal.secret.properties >> ./gradle.properties |
| 54 | + |
| 55 | + - name: Publish artifacts to Maven |
| 56 | + # Since we're in the `v1`/`1.x-dev` branch already, this means that tests of a PR passed. |
| 57 | + # So, no need to run the tests again when publishing.\ |
| 58 | + # |
| 59 | + # Also, we don't want to update the GitHub Pages content, as it may be already |
| 60 | + # updated with the contents of 2.x branch. So this operation should be performed |
| 61 | + # manually, if really needed. |
| 62 | + # See https://github.com/SpineEventEngine/config/tree/master/scripts/publish-documentation. |
| 63 | + run: ./gradlew publish -x test -x updateGitHubPages --stacktrace |
| 64 | + env: |
| 65 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + FORMAL_GIT_HUB_PAGES_AUTHOR: developers@spine.io |
| 67 | + # https://docs.github.com/en/actions/reference/environment-variables |
| 68 | + REPO_SLUG: $GITHUB_REPOSITORY # e.g. SpineEventEngine/core-java |
| 69 | + GOOGLE_APPLICATION_CREDENTIALS: ./maven-publisher.json |
| 70 | + NPM_TOKEN: ${{ secrets.NPM_SECRET }} |
0 commit comments