Skip to content

Commit 7799518

Browse files
authored
feat: add GH action to update dependencies (#141)
1 parent 262149b commit 7799518

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Update dependencies
2+
on:
3+
schedule:
4+
# Run automatically at 7AM PST Tuesday
5+
- cron: '0 14 * * 2'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-dependencies-and-test:
10+
name: Update Dependencies & Test
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 20
13+
strategy:
14+
max-parallel: 1
15+
matrix:
16+
java: [ 8, 11, 17 ]
17+
18+
steps:
19+
- name: Checkout java-http-client
20+
uses: actions/checkout@v2
21+
22+
- name: Set up Java
23+
uses: actions/setup-java@v2
24+
with:
25+
distribution: 'temurin'
26+
java-version: ${{ matrix.java }}
27+
cache: 'maven'
28+
29+
- name: Updating semver dependencies
30+
run: make update-deps
31+
32+
- run: mvn install -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
33+
34+
- name: Add & Commit
35+
if: matrix.java == '17'
36+
uses: EndBug/[email protected]
37+
with:
38+
add: 'pom.xml'
39+
default_author: 'github_actions'
40+
message: 'chore: update java-http-client dependencies'
41+
42+
notify-on-failure:
43+
name: Slack notify on failure
44+
if: failure()
45+
needs: [ update-dependencies-and-test ]
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: rtCamp/action-slack-notify@v2
49+
env:
50+
SLACK_COLOR: failure
51+
SLACK_ICON_EMOJI: ':github:'
52+
SLACK_MESSAGE: ${{ format('Update dependencies *{0}*, {1}/{2}/actions/runs/{3}', needs.update-dependencies-and-test.result, github.server_url, github.repository, github.run_id) }}
53+
SLACK_TITLE: Action Failure - ${{ github.repository }}
54+
SLACK_USERNAME: GitHub Actions
55+
SLACK_MSG_AUTHOR: twilio-dx
56+
SLACK_FOOTER: Posted automatically using GitHub Actions
57+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
58+
MSG_MINIMAL: true

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install package test test-integration clean
1+
.PHONY: install package test update-deps test-integration clean
22

33
VERSION := $(shell mvn help:evaluate -Dexpression=project.version --batch-mode | grep -e '^[^\[]')
44
install:
@@ -13,5 +13,8 @@ package:
1313
test:
1414
mvn test
1515

16+
update-deps:
17+
mvn versions:use-latest-releases versions:commit -DallowMajorUpdates=false
18+
1619
clean:
1720
mvn clean

0 commit comments

Comments
 (0)