-
Notifications
You must be signed in to change notification settings - Fork 12
79 lines (67 loc) · 2.3 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (67 loc) · 2.3 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
name: Build and Release Plugin
on:
push:
branches:
- '**'
jobs:
build-artifact:
runs-on: ubuntu-latest
outputs:
plugin_version: ${{ steps.get_version.outputs.plugin_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Gradle
uses: gradle/gradle-build-action@v3
- name: Extract plugin version
id: get_version
run: |
version=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2)
echo "$version" > plugin-version.txt
echo "plugin_version=$version" >> $GITHUB_OUTPUT
- name: Build plugin
run: ./gradlew buildPlugin
- name: Rename plugin artifact
run: |
mv build/distributions/*.zip YALI_${{ steps.get_version.outputs.plugin_version }}.zip
- name: Upload plugin artifact
uses: actions/upload-artifact@v4
with:
name: YALI_${{ steps.get_version.outputs.plugin_version }}
path: YALI_${{ steps.get_version.outputs.plugin_version }}.zip
- name: Upload plugin version file
uses: actions/upload-artifact@v4
with:
name: plugin-version
path: plugin-version.txt
release:
if: github.ref == 'refs/heads/master'
needs: build-artifact
runs-on: ubuntu-latest
steps:
- name: Download plugin version file
uses: actions/download-artifact@v4
with:
name: plugin-version
- name: Read plugin version
id: read_version
run: |
version=$(cat plugin-version.txt)
echo "plugin_version=$version" >> $GITHUB_OUTPUT
- name: Download plugin artifact
uses: actions/download-artifact@v4
with:
name: YALI_${{ steps.read_version.outputs.plugin_version }}
- name: Create Release and Upload Artifact
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.read_version.outputs.plugin_version }}
name: Release v${{ steps.read_version.outputs.plugin_version }}
files: YALI_${{ steps.read_version.outputs.plugin_version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}