-
Notifications
You must be signed in to change notification settings - Fork 24
54 lines (52 loc) · 1.89 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Release artifacts
on:
push:
tags:
- \d.\d.\d
- \d.\d.\d-(alpha|rc)\d\d
jobs:
production-release:
runs-on: ubuntu-latest
services:
app:
image: ghcr.io/deploygate/gradle-plugin-mock-server
ports:
- 3000/tcp
options: >-
--health-cmd "curl -fI http://localhost:3000"
--health-interval 15s
--health-timeout 5s
--health-retries 5
--health-start-period 20s
steps:
- uses: actions/checkout@v4
with:
ref: master
- uses: actions/checkout@v4
- run: |
if [[ "$(cat src/main/resources/VERSION)" != "${GITHUB_REF#refs/tags/}" ]]; then
echo "version must keep the consistency" 1>&2
exit 1
fi
- uses: ./.github/actions/setup-java
- name: Set up gradle.properties for signing and nexus
# Add timeout setting due to https://github.com/DeployGate/gradle-deploygate-plugin/runs/2523846388
run: |
echo >> gradle.properties
cat<<EOF >> gradle.properties
systemProp.org.gradle.internal.http.socketTimeout=120000
nexusUsername=${{ secrets.SHARED_NEXUS_USERNAME }}
nexusPassword=${{ secrets.SHARED_NEXUS_PASSWORD }}
EOF
- name: Publish artifacts
run: ./release.sh
env:
TEST_SERVER_URL: http://localhost:${{ job.services.app.ports[3000] }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: 'Gradle Plugin Release'
SLACK_MESSAGE: "${{ github.ref }} has been published to Sonatype. ref: https://oss.sonatype.org/"
SLACK_WEBHOOK: ${{ secrets.SHARED_FOR_RELEASE_ARTIFACT_SLACK_INCOMING_WEBHOOK_URL }}