Skip to content

Commit f2e1ac5

Browse files
update github actions
1 parent 41e3ae8 commit f2e1ac5

3 files changed

Lines changed: 79 additions & 24 deletions

File tree

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
# Maven dependencies (httpclient, gson, junit, plugins, etc.)
4+
- package-ecosystem: "maven"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 5
9+
labels:
10+
- "dependencies"
11+
12+
# GitHub Actions used in the workflows
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
open-pull-requests-limit: 5
18+
labels:
19+
- "ci"
20+
- "dependencies"

.github/workflows/deploy.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # required for softprops/action-gh-release to create the release
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 11
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '11'
22+
distribution: 'temurin'
23+
cache: 'maven'
24+
server-id: central
25+
server-username: MAVEN_USERNAME
26+
server-password: MAVEN_PASSWORD
27+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
28+
gpg-passphrase: GPG_PASSPHRASE
29+
30+
- name: Set version from tag
31+
run: |
32+
TAG=${GITHUB_REF#refs/tags/}
33+
# Accept v1.2.3, testingbotrest-1.2.3, or a bare 1.2.3
34+
TAG_VERSION=${TAG#v}
35+
TAG_VERSION=${TAG_VERSION#testingbotrest-}
36+
echo "Releasing version ${TAG_VERSION} (from tag ${TAG})"
37+
mvn -B versions:set -DnewVersion=${TAG_VERSION} -DgenerateBackupPoms=false
38+
39+
- name: Run tests
40+
run: mvn -B test
41+
env:
42+
TB_KEY: ${{ secrets.TB_KEY }}
43+
TB_SECRET: ${{ secrets.TB_SECRET }}
44+
45+
- name: Publish to Maven Central
46+
run: mvn -B clean deploy -DskipTests
47+
env:
48+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
49+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
50+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
51+
52+
- name: Upload artifacts to GitHub Release
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
files: |
56+
target/testingbotrest-*.jar
57+
generate_release_notes: true
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)