-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (76 loc) · 2.42 KB
/
release.yml
File metadata and controls
89 lines (76 loc) · 2.42 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Tag the repository and make a GitHub release
on:
workflow_dispatch:
inputs:
release:
type: boolean
description: Make a GitHub release
default: true
jobs:
package:
name: Build Package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Package the plugin
run: mvn package
- name: Build plugin artifacts zip
run: |
zip --junk-paths plugin-artifacts target/*.jar
- name: Upload plugin artifacts
uses: actions/upload-artifact@v4
with:
name: plugin-artifacts.zip
path: plugin-artifacts.zip
make_release:
runs-on: ubuntu-latest
needs: package
permissions: write-all
if: ${{ github.event.inputs.release == 'true'}}
steps:
- name: Download code
uses: actions/checkout@v3
- name: Conventional changelog action
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-version-file: "true"
skip-on-empty: "false"
skip-tag: "true"
skip-commit: "true"
- name: Fetch release version from build maven
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Download plugin artifacts
uses: actions/download-artifact@v4
with:
name: plugin-artifacts.zip
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
body: ${{ steps.changelog.outputs.clean_changelog }}
draft: false
prerelease: false
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./plugin-artifacts.zip
asset_name: plugin-artifacts.zip
asset_content_type: application/zip