-
Notifications
You must be signed in to change notification settings - Fork 26
80 lines (69 loc) · 2.08 KB
/
publish.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
name: Publish
on:
push:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_USERNAME: ${{ vars.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build and Publish
run: ./gradlew build publish --no-daemon -PMAVEN_USERNAME=$MAVEN_USERNAME -PMAVEN_PASSWORD=$MAVEN_PASSWORD
- name: Upload common Artifact
uses: actions/upload-artifact@v3
with:
name: youtube-common.jar
path: common/build/libs/youtube-common-*.jar
- name: Upload lldevs Artifact
uses: actions/upload-artifact@v3
with:
name: youtube-v2.jar
path: v2/build/libs/youtube-v2-*.jar
- name: Upload plugin Artifact
uses: actions/upload-artifact@v3
with:
name: youtube-plugin.jar
path: plugin/build/libs/youtube-plugin-*.jar
release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download youtube-common Artifact
uses: actions/download-artifact@v3
with:
name: youtube-common.jar
- name: Download youtube-v2 Artifact
uses: actions/download-artifact@v3
with:
name: youtube-v2.jar
- name: Download youtube-plugin Artifact
uses: actions/download-artifact@v3
with:
name: youtube-plugin.jar
- name: Upload Artifacts to GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: '*.jar'
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true