forked from PssbleTrngle/GradleHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.62 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (58 loc) · 1.62 KB
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
name: Release
on:
workflow_dispatch:
release:
types: [ published ]
push:
branches: [ "v[0-9]+.[0-9]+" ]
paths-ignore:
- "docs/**"
- ".github/workflows/release-docs.yml"
env:
CI: true
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }}
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_TOKEN: ${{ secrets.NEXUS_TOKEN }}
PATCH: ${{ github.run_number }}
RELEASE: ${{ github.event_name == 'release' }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
java-version: 25
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-read-only: true
- name: Build
run: ./gradlew build
- name: Publish Semver
run: ./gradlew publishAll
- name: Publish Snapshots
run: ./gradlew publishAll
env:
SNAPSHOT: true
- uses: actions/upload-artifact@v7
with:
archive: false
path: build/release.json
retention-days: 1
- name: Trigger Test Mod
uses: peter-evans/repository-dispatch@v4
if: ${{ github.event_name != 'release' }}
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repository: ${{ github.actor }}/TestMod
event-type: trigger-test
client-payload: '{"version": "${{ github.ref_name }}"}'