-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (66 loc) · 2.21 KB
/
release.yml
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
name: Release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
outputs:
version: ${{ steps.properties.outputs.artifactName }}
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- name: Setup properties
id: properties
shell: bash
run: |
NAME=$(grep "^pluginName=" plugin.properties | cut -d '=' -f 2)
VERSION=$(grep "^version=" plugin.properties | cut -d '=' -f 2)
echo "NAME=$NAME"
echo "VERSION=$VERSION"
echo "name=$NAME" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_ENV
echo "artifactName=$NAME-$VERSION" >> $GITHUB_ENV
- name: Sign and Verify IntelliJ Plugin
uses: ./.github/actions/sign-and-verify-intellij-plugin
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Marketplace
run: ./gradlew publishPlugin
- name: Remove old drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
- name: Create draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.artifactName }} \
--draft \
--title "${{ env.artifactName }}" \
--notes ""
- name: Upload release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ env.artifactName }} ./idea-plugin/build/distributions/*-signed.zip