|
11 | 11 |
|
12 | 12 | jobs: |
13 | 13 | build: |
14 | | - name: Build |
15 | | - runs-on: ubuntu-latest |
16 | | - timeout-minutes: 15 |
17 | | - outputs: |
18 | | - xoom_version: ${{ steps.version.outputs.xoom_version }} |
19 | | - |
20 | | - steps: |
21 | | - - uses: actions/checkout@v2 |
22 | | - |
23 | | - - name: Set up JDK 1.8 |
24 | | - uses: actions/setup-java@v1 |
25 | | - with: |
26 | | - java-version: 1.8 |
27 | | - |
28 | | - - name: Cache Maven packages |
29 | | - uses: actions/cache@v2 |
30 | | - with: |
31 | | - path: ~/.m2/repository |
32 | | - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
33 | | - restore-keys: ${{ runner.os }}-m2- |
34 | | - |
35 | | - - name: Determine version |
36 | | - id: version |
37 | | - run: echo "::set-output name=xoom_version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" |
38 | | - |
39 | | - - name: Build with Maven |
40 | | - run: mvn --batch-mode --update-snapshots -Pgithub-releases install -Dtest=\!SecureClientTest |
41 | | - |
42 | | - - name: Publish artifacts |
43 | | - uses: actions/upload-artifact@v2 |
44 | | - with: |
45 | | - name: JARs |
46 | | - path: target/*.jar |
47 | | - |
48 | | - - name: Notify slack |
49 | | - if: always() && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository_owner == 'vlingo' |
50 | | - uses: rtCamp/action-slack-notify@v2 |
51 | | - env: |
52 | | - SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" |
53 | | - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
54 | | - SLACK_CHANNEL: ci-cd |
55 | | - SLACK_USERNAME: Bob the Builder |
56 | | - SLACK_ICON: 'https://vlingo.io/wp-content/uploads/cropped-vlingo-favicon-180x180.png' |
57 | | - SLACK_FOOTER: '${{ github.repository }}:${{ steps.version.outputs.xoom_version }}' |
58 | | - |
59 | | - deploy-github: |
60 | | - name: Deploy to GitHub |
61 | | - runs-on: ubuntu-latest |
62 | | - needs: build |
63 | | - if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && github.repository_owner == 'vlingo' |
64 | | - steps: |
65 | | - |
66 | | - - uses: actions/checkout@v2 |
67 | | - |
68 | | - - name: Set up JDK 1.8 |
69 | | - uses: actions/setup-java@v1 |
70 | | - with: |
71 | | - java-version: 1.8 |
72 | | - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} |
73 | | - gpg-passphrase: MAVEN_GPG_PASSPHRASE |
74 | | - |
75 | | - - name: Cache Maven packages |
76 | | - uses: actions/cache@v2 |
77 | | - with: |
78 | | - path: ~/.m2/repository |
79 | | - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
80 | | - restore-keys: ${{ runner.os }}-m2- |
81 | | - |
82 | | - - name: Deploy |
83 | | - run: mvn --batch-mode -DskipTests -DuseGitHubPackages -DsignArtifacts -Pgithub-releases deploy |
84 | | - env: |
85 | | - GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }} |
86 | | - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
87 | | - |
88 | | - - name: Notify slack |
89 | | - if: failure() |
90 | | - uses: rtCamp/action-slack-notify@v2 |
91 | | - env: |
92 | | - SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" |
93 | | - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
94 | | - SLACK_CHANNEL: ci-cd |
95 | | - SLACK_USERNAME: Suzi the Publisher |
96 | | - SLACK_ICON: 'https://vlingo.io/wp-content/uploads/cropped-vlingo-favicon-180x180.png' |
97 | | - SLACK_FOOTER: '${{ github.repository }}' |
98 | | - SLACK_TITLE: 'GitHub Deployment' |
99 | | - SLACK_MESSAGE: ':rocket: ${{ needs.build.outputs.xoom_version }}' |
100 | | - |
101 | | - deploy-central: |
102 | | - name: Deploy to Maven Central |
103 | | - runs-on: ubuntu-latest |
104 | | - needs: build |
105 | | - if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && github.repository_owner == 'vlingo' |
106 | | - steps: |
107 | | - |
108 | | - - uses: actions/checkout@v2 |
109 | | - |
110 | | - - name: Set up JDK 1.8 |
111 | | - uses: actions/setup-java@v1 |
112 | | - with: |
113 | | - java-version: 1.8 |
114 | | - server-id: central-repository-ossrh |
115 | | - server-username: MAVEN_USERNAME |
116 | | - server-password: MAVEN_PASSWORD |
117 | | - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} |
118 | | - gpg-passphrase: MAVEN_GPG_PASSPHRASE |
119 | | - |
120 | | - - name: Configure an additional Maven repository |
121 | | - run: sed -i'.bkp' -e 's/\(<\/servers>\)/ <server><id>github<\/id><username>\${env.GITHUB_ACTOR}<\/username><password>\${env.GITHUB_TOKEN}<\/password><\/server>\n\1/g' ~/.m2/settings.xml |
122 | | - |
123 | | - - name: Cache Maven packages |
124 | | - uses: actions/cache@v2 |
125 | | - with: |
126 | | - path: ~/.m2/repository |
127 | | - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
128 | | - restore-keys: ${{ runner.os }}-m2- |
129 | | - |
130 | | - - name: Deploy |
131 | | - run: mvn --batch-mode -DskipTests -DuseSonatype -DsignArtifacts -Pgithub-releases deploy |
132 | | - env: |
133 | | - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} |
134 | | - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |
135 | | - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
136 | | - |
137 | | - - name: Trigger downstream builds |
138 | | - if: startsWith(github.ref, 'refs/tags/') |
139 | | - run: .github/trigger_deps.sh |
140 | | - env: |
141 | | - RELEASE_GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} |
142 | | - |
143 | | - - name: Notify slack |
144 | | - if: startsWith(github.ref, 'refs/tags/') || failure() |
145 | | - uses: rtCamp/action-slack-notify@v2 |
146 | | - env: |
147 | | - SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" |
148 | | - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
149 | | - SLACK_CHANNEL: ci-cd |
150 | | - SLACK_USERNAME: Suzi the Publisher |
151 | | - SLACK_ICON: 'https://vlingo.io/wp-content/uploads/cropped-vlingo-favicon-180x180.png' |
152 | | - SLACK_FOOTER: '${{ github.repository }}' |
153 | | - SLACK_TITLE: 'Sonatype Deployment' |
154 | | - SLACK_MESSAGE: ':rocket: ${{ needs.build.outputs.xoom_version }}' |
| 14 | + name: Build and Deploy |
| 15 | + uses: vlingo/xoom-platform/.github/workflows/build.yml@master |
| 16 | + secrets: inherit |
| 17 | + with: |
| 18 | + maven-build-cmd: mvn --batch-mode --update-snapshots -Pgithub-releases install -Dtest=\!SecureClientTest |
0 commit comments