-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (100 loc) · 3.89 KB
/
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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Release
on:
workflow_dispatch:
pull_request_target:
branches:
- master
types:
- closed
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
get-versions:
runs-on: ubuntu-latest
needs: [ setup ]
outputs:
versions: ${{ steps.versions.outputs.value }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get versions
id: versions
run: |
VERSIONS=`python tools/getVersions.py`
echo $VERSIONS
echo "value=${VERSIONS}" >> $GITHUB_OUTPUT
create-release:
runs-on: ubuntu-latest
needs: [ setup, get-versions ]
outputs:
version: ${{ steps.tag_version.outputs.new_version }}
release-upload-url: ${{ steps.create_release.outputs.upload_url }}
release-html-url: ${{ steps.create_release.outputs.html_url }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: "minor"
custom_release_rules: "feat:minor:✨ Features,fix:patch:🐛 Bug Fixes,docs:patch:📰 Docs,chore:patch:🎨 Chore,pref:patch:🎈 Performance improvements,refactor:patch:🧹 Refactoring,build:patch:🔍 Build,ci:patch:🔍 CI,revert:patch:⏪ Revert,style:patch:🧹 Style,test:patch:👀 Test"
- name: Publish release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
build:
runs-on: ubuntu-latest
needs: [ setup, get-versions, create-release ]
strategy:
fail-fast: false
matrix:
versions: ${{ fromJson(needs.get-versions.outputs.versions) }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Manage matrix
id: manage-matrix
run: |
echo "groupId=${{ fromJson(matrix.versions).groupId }}" >> $GITHUB_OUTPUT
echo "javadoc_version=${{ fromJson(matrix.versions).javadoc_version }}" >> $GITHUB_OUTPUT
echo "version=${{ fromJson(matrix.versions).version }}" >> $GITHUB_OUTPUT
echo "java_version=${{ fromJson(matrix.versions).java_version }}" >> $GITHUB_OUTPUT
- name: Set up JDK ${{ steps.manage-matrix.outputs.java_version }}
uses: actions/setup-java@v2
with:
java-version: ${{ steps.manage-matrix.outputs.java_version }}
distribution: adopt
- name: Install dependencies
run: |
pip install requests
pip install beautifulsoup4
- name: Create event files
run: python tools/getEvents.py ${{ steps.manage-matrix.outputs.javadoc_version }}
- name: Build with Maven
run: mvn package -Dversion=${{ needs.create-release.outputs.version }} -Djava.version=${{ steps.manage-matrix.outputs.java_version }} -Dpapermc.groupId=${{ steps.manage-matrix.outputs.groupId }} -Dpapermc.version=${{ steps.manage-matrix.outputs.version }}
- name: Upload Release Asset
uses: shogo82148/actions-upload-release-asset@v1.5.0
with:
upload_url: ${{ needs.create-release.outputs.release-upload-url }}
asset_path: target/*-${{ steps.manage-matrix.outputs.version }}.jar