diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml new file mode 100644 index 0000000..0dd69a7 --- /dev/null +++ b/.github/workflows/update-dependencies.yml @@ -0,0 +1,58 @@ +name: Update dependencies +on: + schedule: + # Run automatically at 7AM PST Tuesday + - cron: '0 14 * * 2' + workflow_dispatch: + +jobs: + update-dependencies-and-test: + name: Update Dependencies & Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + max-parallel: 1 + matrix: + java: [ 8, 11, 17 ] + + steps: + - name: Checkout java-http-client + uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Updating semver dependencies + run: make update-deps + + - run: mvn install -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + + - name: Add & Commit + if: matrix.java == '17' + uses: EndBug/add-and-commit@v8.0.2 + with: + add: 'pom.xml' + default_author: 'github_actions' + message: 'chore: update java-http-client dependencies' + + notify-on-failure: + name: Slack notify on failure + if: failure() + needs: [ update-dependencies-and-test ] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: failure + SLACK_ICON_EMOJI: ':github:' + 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) }} + SLACK_TITLE: Action Failure - ${{ github.repository }} + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/Makefile b/Makefile index 3d76197..851986a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: install package test test-integration clean +.PHONY: install package test update-deps test-integration clean VERSION := $(shell mvn help:evaluate -Dexpression=project.version --batch-mode | grep -e '^[^\[]') install: @@ -13,5 +13,8 @@ package: test: mvn test +update-deps: + mvn versions:use-latest-releases versions:commit -DallowMajorUpdates=false + clean: mvn clean