-
Notifications
You must be signed in to change notification settings - Fork 362
62 lines (61 loc) · 2.37 KB
/
linux-build-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
55
56
57
58
59
60
61
62
name: Build and Release [Linux]
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Set up Docker private registry
run: |
docker run -d -p 5000:5000 --restart=always --name registry registry:2
docker run -d -p 5001:5000 --restart=always --name secure_registry -v "$(pwd)"/src/functTest/resources/auth:/auth:rw -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" registry:2
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Compilation
run: ./gradlew classes
- name: Validate plugins
run: ./gradlew validatePlugins
- name: Unit tests
run: ./gradlew test
- name: Integration tests
run: ./gradlew integrationTest
- name: Functional tests
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
run: ./gradlew functionalTest
- name: Documentation tests
run: ./gradlew docTest
- name: Assemble artifacts
run: ./gradlew assemble javadoc asciidoctorAllGuides
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: gradle-docker-plugin-bin
path: build/libs/*.jar
- name: Upload Javadoc
uses: actions/upload-artifact@v3
with:
name: gradle-docker-plugin-javadoc
path: build/docs/javadoc/
- name: Upload Guides
uses: actions/upload-artifact@v3
with:
name: gradle-docker-plugin-guides
path: |
build/docs/asciidocDevGuide/
build/docs/asciidocUserGuide/
- name: Release
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew publishPlugins gitPublishPush -Pgradle.publish.key=${{ secrets.PLUGIN_PORTAL_KEY }} -Pgradle.publish.secret=${{ secrets.PLUGIN_PORTAL_SECRET }} -Dorg.ajoberstar.grgit.auth.username=${{ secrets.GH_TOKEN }} -is