Repository navigation
94 lines (78 loc) · 2.89 KB
/
Copy pathrelease-plugin-kotlin.yml
File metadata and controls
94 lines (78 loc) · 2.89 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
90
91
92
93
94
name: Release Kotlin Plugin
on:
workflow_dispatch:
inputs:
tag:
description: "Semantic version for the plugin release (e.g. 1.0.0). The 'plugin-kotlin-v' prefix is added automatically."
required: true
permissions:
contents: write
jobs:
validate:
name: Validate version
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.compute.outputs.tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Validate version and compute tag
id: compute
env:
VERSION: ${{ github.event.inputs.tag }}
run: |
PREFIX="plugin-kotlin-v"
# Back-compat: accept the full tag form (e.g. plugin-kotlin-v1.0.4) too, not just
# the bare version. DO NOT REMOVE: old forks pass the full tag when releasing.
VERSION="${VERSION#"$PREFIX"}"
# Tolerate a bare "v" prefix (e.g. v1.0.4) so the tag isn't doubled below.
VERSION="${VERSION#v}"
# Validate via the shared script (same semver check as the auto-updater).
go run ./cmd/scripts/semver "$VERSION"
echo "tag=${PREFIX}${VERSION}" >> "$GITHUB_OUTPUT"
echo "Version '$VERSION' is valid. Release tag: ${PREFIX}${VERSION}"
release:
name: Build and Release Kotlin Plugin
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build fat JAR
working-directory: plugin/kotlin
run: ./gradlew fatJar --no-daemon
- name: Prepare release artifacts
working-directory: plugin/kotlin
run: |
mkdir -p release
cp build/libs/canopy-plugin-kotlin-*-all.jar release/kotlin-plugin.jar
cd release && tar -czf kotlin-plugin.tar.gz kotlin-plugin.jar
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.validate.outputs.tag }}
name: "Kotlin Plugin ${{ needs.validate.outputs.tag }}"
body: |
Kotlin Plugin Release ${{ needs.validate.outputs.tag }}
## Requirements
- Java Runtime Environment (JRE) 21 or later
## Installation
1. Download `kotlin-plugin.tar.gz` to `plugin/kotlin/`
2. The plugin will auto-extract on first start
## Assets
- `kotlin-plugin.tar.gz` - Fat JAR with all dependencies included
files: |
plugin/kotlin/release/kotlin-plugin.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}