-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.46 KB
/
gradle.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
# (c) https://github.com/MontiCore/monticore
name: Gradle
concurrency: # run this test workflow only once per "branch"
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push: # run this test pipeline on every push
pull_request: # and pull request
repository_dispatch: # and on request of upstream projects
types: [ trigger_after_upstream_deploy ]
env:
GRADLE_VERSION: 7.4 # Gradle version used
GRADLE_CLI_OPTS: "-Pci --build-cache " # CLI options passed to Gradle
permissions:
contents: read # This action may run somewhat unsafe code
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Gradle build
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build ${{env.GRADLE_CLI_OPTS}}
deploy:
permissions:
packages: write
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Gradle publish
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: publish ${{env.GRADLE_CLI_OPTS}} -PmavenPassword=${{ secrets.SE_NEXUS_PASSWORD }} -PmavenUser=${{ secrets.SE_NEXUS_USER }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}