-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (74 loc) · 2.81 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (74 loc) · 2.81 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: Publish release
on:
release:
types: [published]
permissions:
contents: read
concurrency:
group: publish-${{ github.event.release.tag_name }}
cancel-in-progress: false
jobs:
vscode:
name: Visual Studio Marketplace
if: ${{ startsWith(github.event.release.tag_name, 'invariant-v') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-node@v7
with:
node-version: 'lts/*'
- run: echo "PLUGIN_VERSION=${GITHUB_REF_NAME#invariant-v}" >> "$GITHUB_ENV"
- name: Check release version
run: test "$(node -p "require('./vscode/package.json').version")" = "$PLUGIN_VERSION"
- run: npm test --prefix vscode
- run: npm run package --prefix vscode
- name: Attach VS Code extension
run: gh release upload "$GITHUB_REF_NAME" "vscode/invariant-colors-$PLUGIN_VERSION.vsix" --clobber
env:
GH_TOKEN: ${{ github.token }}
- name: Publish to Visual Studio Marketplace
if: ${{ !github.event.release.prerelease }}
run: npx --yes @vscode/vsce@3.9.2 publish --packagePath "vscode/invariant-colors-$PLUGIN_VERSION.vsix"
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to Open VSX
if: ${{ !github.event.release.prerelease }}
run: npx --yes ovsx@1.1.1 publish "vscode/invariant-colors-$PLUGIN_VERSION.vsix"
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
jetbrains:
name: JetBrains Marketplace
if: ${{ startsWith(github.event.release.tag_name, 'invariant-v') }}
runs-on: ubuntu-latest
permissions:
contents: write
env:
PUBLISH_TOKEN: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
- run: echo "PLUGIN_VERSION=${GITHUB_REF_NAME#invariant-v}" >> "$GITHUB_ENV"
# Restores the Gradle cache JetBrains CI writes on master, so the IntelliJ
# Platform is not downloaded again here. Left read-only on purpose: this job
# runs on a tag, and a cache written under one tag is unreadable from every
# other tag.
- uses: gradle/actions/setup-gradle@v6
with:
gradle-version: 9.7.0
- run: gradle buildPlugin verifyPlugin
working-directory: jetbrains
- name: Attach JetBrains plugin
run: gh release upload "$GITHUB_REF_NAME" "jetbrains/build/distributions/invariant-$PLUGIN_VERSION.zip" --clobber
env:
GH_TOKEN: ${{ github.token }}
- if: ${{ !github.event.release.prerelease }}
run: gradle -p jetbrains publishPlugin