-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (68 loc) · 2.38 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
81
82
name: Build and Publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.ACTIONS_COMMIT }}
- name: Recovery tag information
run: git fetch --tags --force
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 16
distribution: microsoft
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Test and Build
run: ./gradlew test build -Psemver.overrideVersion=${{ github.ref_name }}
- name: Get prev tag
id: prev-tag
run: echo "::set-output name=tag::$(git describe --abbrev=0 --tags $(git describe --abbrev=0)^ --match 'v[0-9]*' --exclude *-*)"
- uses: seasonalmatcha/conventional-commit-changelog@latest
id: changelog
with:
from: ${{ steps.prev-tag.outputs.tag }}
to: ${{ github.ref_name }}
# - name: Prepend Changelog
# if: steps.changelog.outputs.changelog != 'No Changes'
# uses: endaft/[email protected]
# with:
# file_target: CHANGELOG.md
# value_in: ${{ format('# {0}\n{1}\n', steps.tag.outputs.version, steps.changelog.outputs.changelog) }}
# is_file: "false"
- name: Get the version
id: version
run: echo ::set-output name=version::$(echo ${{ github.ref_name }} | cut -c2-)
- uses: DamianReeves/[email protected]
with:
path: DESC
contents: ${{ steps.changelog.outputs.changelog }}
write-mode: overwrite
- uses: actions/upload-artifact@v3
if: steps.changelog.outputs.changelog != 'No Changes'
with:
name: plugin
path: build/libs/EpicBanItem-${{ steps.version.outputs.version }}.jar
if-no-files-found: error
- uses: actions/upload-artifact@v3
if: steps.changelog.outputs.changelog != 'No Changes'
with:
name: desc
path: DESC
if-no-files-found: error
- name: Upload to Ore
if: steps.changelog.outputs.changelog != 'No Changes'
uses: dualspiral/ore-upload-action@v2
with:
plugin: plugin
description: desc
apiKey: ${{ secrets.ORE_API_KEY }}
pluginId: epicbanitem