-
Notifications
You must be signed in to change notification settings - Fork 53
102 lines (99 loc) · 3.48 KB
/
build.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: build
on:
workflow_dispatch:
push:
tags:
- 'v[6]+.[0-9]+.[0-9]+*'
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
#- name: Fetch git tags to know if this is a release
# run: git fetch --prune --unshallow --tags
- name: Pull full tag information if any so `git describe` works in gradle
run: git fetch -uf origin ${{ github.ref }}:${{ github.ref }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Sync cache
uses: actions/cache@v2
with:
path: |
~/.gradle
key: .gradle
- name: Build SNAPSHOT with Gradle
env:
REF: ${{ github.ref }}
MAVEN_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
ARTIFACT_VERSION: 6-SNAPSHOT
run: if [[ "$REF" == "refs/heads/master" ]]; then ./gradlew setupCIWorkspace build uploadArchives --stacktrace; fi
- name: Build RELEASE with Gradle
env:
REF: ${{ github.ref }}
MAVEN_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
ONLY_RELEASES: true
run: if [[ "$REF" == "refs/tags/v"* ]]; then rm -rf ./build/libs; mkdir -p ./build/libs; ./gradlew testIfUploadable setupCIWorkspace build uploadArchives --stacktrace; fi
#- name: Workflow Dispatch
#uses: benc-uk/workflow-dispatch@v1
#with:
#workflow: release-completed
regenerate-website:
runs-on: ubuntu-20.04
needs: [build]
steps:
- name: Regenerate website
env:
MAVEN_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
run: curl -X PUT ${MAVEN_URL}/REGEN -u "${MAVEN_USERNAME}:${MAVEN_PASSWORD}" --data ''
webhook-dispatch:
runs-on: ubuntu-22.04
needs: [build, regenerate-website]
steps:
- name: Webhook dispatch
uses: distributhor/workflow-webhook@v3
env:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}
post-to-forum:
runs-on: ubuntu-20.04
needs: [build, regenerate-website]
steps:
- uses: actions/checkout@v2
#- name: Fetch git tags to know if this is a release
# run: git fetch --prune --unshallow --tags
- name: Pull full tag information if any so `git describe` works in gradle
run: git fetch -uf origin ${{ github.ref }}:${{ github.ref }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Sync cache
uses: actions/cache@v2
with:
path: |
~/.gradle
key: .gradle
- name: Post RELEASE to forum
env:
REF: ${{ github.ref }}
MAVEN_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
ONLY_RELEASES: true
FORUM_SECRETS: ${{ secrets.FORUM_SECRETS }}
run: if [[ "$REF" == "refs/tags/v"* ]]; then ./gradlew testIfUploadable && .meta/ci/post_forum_post.sh || true; fi