Skip to content

Commit c870a12

Browse files
authored
Create Release
1 parent c37d347 commit c870a12

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*'
7+
8+
jobs:
9+
greet:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Set LD_VERSION
17+
run: echo ::set-env name=LD_VERSION::${GITHUB_REF#refs/*/v}
18+
19+
- name: Set up JDK 1.8
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 1.8
23+
24+
- name: Grant execute permission for gradlew
25+
run: chmod +x gradlew
26+
27+
- name: Build the plugin
28+
run: ./gradlew buildPlugin
29+
env:
30+
LD_VERSION: ${{ env.LD_VERSION }}
31+
32+
- name: Verify plugin
33+
id: verify
34+
uses: ChrisCarini/intellij-platform-plugin-verifier-action@latest
35+
with:
36+
ide-versions: |
37+
ideaIC:2019.3
38+
ideaIC:2020.1
39+
ideaIC:2020.2
40+
ideaIC:LATEST-EAP-SNAPSHOT
41+
42+
- name: Print verify contents
43+
run: |
44+
echo "The log file path is: ${{steps.verify.outputs.verification-output-log-filename}}" ;
45+
cat ${{steps.verify.outputs.verification-output-log-filename}}
46+
47+
- name: Create Release
48+
id: create_release
49+
uses: actions/create-release@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tag_name: ${{ github.ref }}
54+
release_name: ${{ github.ref }}
55+
draft: true
56+
prerelease: false
57+
58+
- name: Upload Release Asset
59+
id: upload-release-asset
60+
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
65+
asset_path: ./build/distributions/leetcode-editor-${{ env.LD_VERSION }}.zip
66+
asset_name: leetcode-editor-${{ env.LD_VERSION }}.zip
67+
asset_content_type: application/zip

0 commit comments

Comments
 (0)