-
Notifications
You must be signed in to change notification settings - Fork 9
108 lines (108 loc) · 3.17 KB
/
deploy.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
103
104
105
106
107
108
name: Publish new release
on:
push:
branches:
- main
jobs:
Deploy-Documentation:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
cache-dependency-path: docs/yarn.lock
- name: Install dependencies
working-directory: ./docs
run: yarn install --frozen-lockfile
- name: Build website
working-directory: ./docs
run: yarn build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
Build-Deploy-Java-8:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
- run: gradle :shadowJar -b java8-build.gradle
- uses: actions/upload-artifact@v4
with:
name: commandtimer-java8
path: build/libs/commandtimer-java8.jar
- name: Publish package
run: gradle publish -b java8-build.gradle
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Build-Deploy-Java-17:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- run: gradle :shadowJar -b java17-build.gradle
- uses: actions/upload-artifact@v4
with:
name: commandtimer-java17
path: build/libs/commandtimer-java17.jar
- name: Publish package
continue-on-error: true
run: gradle publish -b java17-build.gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Build-Deploy-Java-21:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '21'
- run: gradle :shadowJar
- uses: actions/upload-artifact@v4
with:
name: commandtimer-java21
path: build/libs/commandtimer-java21.jar
- name: Publish package
run: gradle publish
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Release:
needs:
- Build-Deploy-Java-8
- Build-Deploy-Java-17
- Build-Deploy-Java-21
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
path: artifact
merge-multiple: true
- run: echo "PLUGIN_VERSION=$(./scripts/get-version.sh)" >> $GITHUB_ENV
- run: gh release create ${{ env.PLUGIN_VERSION }} -t ${{ env.PLUGIN_VERSION }} artifact/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}