1313jobs :
1414 test :
1515 name : Test
16- runs-on : ubuntu-latest
16+ runs-on : ubuntu-x64
17+ if : github.repository_owner == 'sendgrid'
1718 timeout-minutes : 20
19+ permissions :
20+ contents : read
1821 strategy :
1922 matrix :
2023 java : [ 8, 11, 17 ]
2124 steps :
2225 - name : Checkout smtpapi-java
23- uses : actions/checkout@v2
26+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2427
2528 - name : Set up Java
26- uses : actions/setup-java@v2
29+ uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2730 with :
2831 distribution : ' temurin'
2932 java-version : ${{ matrix.java }}
@@ -37,19 +40,24 @@ jobs:
3740
3841 deploy :
3942 name : Deploy
40- if : success() && github.ref_type == 'tag'
43+ if : success() && github.ref_type == 'tag' && github.repository_owner == 'sendgrid'
4144 needs : [ test ]
42- runs-on : ubuntu-latest
45+ runs-on : ubuntu-x64
46+ permissions :
47+ contents : write
4348 steps :
4449 - name : Checkout smtpapi-java
45- uses : actions/checkout@v2
50+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+ with :
52+ # The release action verifies refs/tags/<tag> in the local clone.
53+ fetch-depth : 0
4654
4755 - name : Set up Sonatype Maven
48- uses : actions/setup-java@v2
56+ uses : actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
4957 with :
50- java-version : 8
58+ java-version : ' 8 '
5159 distribution : temurin
52- server-id : ossrh
60+ server-id : central
5361 server-username : MAVEN_USERNAME
5462 server-password : MAVEN_PASSWORD
5563 gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
@@ -59,12 +67,11 @@ jobs:
5967 run : make install
6068
6169 - name : Create GitHub Release
62- uses : sendgrid/dx-automator/ actions/release@main
70+ uses : twilio/sdk- actions/github- release@9b1c3222c9ffe38aadedb11c5b9f5a172b5e9951 # v1
6371 with :
6472 assets : smtpapi-java.jar
65- footer : ' **[Maven](https://mvnrepository.com/artifact/com.sendgrid/smtpapi-java/${version})**'
66- env :
67- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+ changelog-file : CHANGELOG.md
74+ footer : ' **[Maven](https://mvnrepository.com/artifact/com.sendgrid/smtpapi-java/${{ github.ref_name }})**'
6875
6976 - name : Publish to Maven
7077 env :
@@ -73,25 +80,25 @@ jobs:
7380 GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
7481 run : mvn clean deploy -DskipTests=true -B -U -Prelease
7582
76- - name : Submit metric to Datadog
77- uses : sendgrid/dx-automator/actions/datadog-release-metric@main
78- env :
79- DD_API_KEY : ${{ secrets.DATADOG_API_KEY }}
83+ # - name: Submit metric to Datadog
84+ # uses: sendgrid/dx-automator/actions/datadog-release-metric@08b601b726671445abc798ed59881766ec8fefc6 # main
85+ # env:
86+ # DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
8087
81- notify-on-failure :
82- name : Slack notify on failure
83- if : failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
84- needs : [ test, deploy ]
85- runs-on : ubuntu-latest
86- steps :
87- - uses : rtCamp/action-slack-notify@v2
88- env :
89- SLACK_COLOR : failure
90- SLACK_ICON_EMOJI : ' :github:'
91- SLACK_MESSAGE : ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
92- SLACK_TITLE : Action Failure - ${{ github.repository }}
93- SLACK_USERNAME : GitHub Actions
94- SLACK_MSG_AUTHOR : twilio-dx
95- SLACK_FOOTER : Posted automatically using GitHub Actions
96- SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
97- MSG_MINIMAL : true
88+ # notify-on-failure:
89+ # name: Slack notify on failure
90+ # if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
91+ # needs: [ test, deploy ]
92+ # runs-on: ubuntu-x64
93+ # steps:
94+ # - uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
95+ # env:
96+ # SLACK_COLOR: failure
97+ # SLACK_ICON_EMOJI: ':github:'
98+ # SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
99+ # SLACK_TITLE: Action Failure - ${{ github.repository }}
100+ # SLACK_USERNAME: GitHub Actions
101+ # SLACK_MSG_AUTHOR: twilio-dx
102+ # SLACK_FOOTER: Posted automatically using GitHub Actions
103+ # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
104+ # MSG_MINIMAL: true
0 commit comments