Repository navigation
114 lines (109 loc) · 4.95 KB
/
Copy pathrelease.yml
File metadata and controls
114 lines (109 loc) · 4.95 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release
# Push a tag v<version> matching plugin.json to publish a GitHub Release with
# one unsigned plugin archive per macOS architecture and its SHA-256 file.
#
# No step receives a signing key. Checkouts do not keep the workflow token.
#
# Releases stay pre-releases, which Lithe Store's tracker skips, for these
# reasons:
# 1. Lithe still bundles Java Support under the old ID
# dev.lithe.plugin.java-support.
# 2. The package declares the Rust backend (backend 2), plugin-owned
# language server sessions (languageServers 3, requestMethods and
# commands) and plugin functions (pluginFunctions 1), and the backend
# links the Rust plugin SDK 0.3.0 (plugin function protocol 4). A host
# that predates the Lithe changes #1745 and #1746 does not offer them and
# rejects the package. Only the latest Lithe preview contains them so far;
# no stable Lithe does. The SDK also requires the host to offer
# litheLogging 1 and refuses to start without it.
# 3. The Maven and Gradle project templates have moved to lithe-plugin-maven
# and lithe-plugin-gradle. Until those plugins carry them, a release
# would drop the Maven and Gradle choices from New Project.
# Remove --prerelease below once a stable Lithe accepts the package (stage E in
# MIGRATION.md), stops bundling Java Support, and offers backend 2,
# languageServers 3, pluginFunctions 1 and litheLogging 1, and once the Maven
# and Gradle plugins are published. The Store then lists stable releases of
# this repository automatically.
on:
push:
tags: ["v*"]
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
test:
name: Rust checks and tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt --all --check
- name: Lint
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Test
run: cargo test --workspace --locked
- name: Check the pinned plugin SDK release
run: scripts/verify-sdk-lock.sh --download
release:
name: Publish ${{ github.ref_name }}
needs: test
runs-on: macos-26
timeout-minutes: 60
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
# scripts/assemble-package.sh compiles the plugin backend for each
# architecture it packages.
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin, x86_64-apple-darwin
- name: Check the tag matches plugin.json
run: |
set -euo pipefail
version=$(plutil -extract version raw -o - io.github.lithe-idea.java-support/plugin.json)
if [[ "$GITHUB_REF_NAME" != "v$version" ]]; then
echo "::error::Tag $GITHUB_REF_NAME does not match plugin.json version $version"
exit 1
fi
- name: Build and verify both architectures
run: |
set -euo pipefail
for arch in arm64 x86_64; do
scripts/build-package.sh --arch "$arch"
done
- name: Archive and publish
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
checksums="$RUNNER_TEMP/checksums.txt"
: > "$checksums"
for arch in arm64 x86_64; do
scripts/archive-package.sh --package ".artifacts/package/$arch/io.github.lithe-idea.java-support" \
--arch "$arch" >> "$checksums"
done
{
echo "Java Support(\`io.github.lithe-idea.java-support\`)${GITHUB_REF_NAME#v}。每个 macOS 架构一个归档,附 SHA-256 文件。"
echo
echo "兼容性:目前的 Lithe 仍内置 Java Support;这个包还需要宿主提供 \`backend\` 2、\`languageServers\` 3、\`pluginFunctions\` 1 和 \`litheLogging\` 1(含 #1745、#1746 的 Lithe 预览版之后),不满足的版本会拒绝安装;稳定版要等 Lithe 主仓库完成 Java 拆分的阶段 E。Maven 与 Gradle 的新建项目模板已移交 lithe-plugin-maven 和 lithe-plugin-gradle,这两个插件接手前,这个包的新建项目里没有 Maven 和 Gradle 选项。"
echo
echo "安装:预发布版本,Lithe Store 自动追踪会跳过。宿主支持后下载对应架构的 ZIP,在 设置 → 插件 的 ⚙ 菜单中选择 从磁盘安装插件…。"
echo
echo "SHA-256:"
echo '```'
sed 's# dist/# #' "$checksums"
echo '```'
} > "$RUNNER_TEMP/notes.md"
gh release create "$GITHUB_REF_NAME" dist/*.zip dist/*.zip.sha256 --verify-tag --prerelease \
--title "Java Support $GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/notes.md"