Skip to content

Commit 34bd835

Browse files
authored
Create release6.x.yml
1 parent 2f33290 commit 34bd835

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/release6.x.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release6.x
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
push:
10+
tags:
11+
- 'v6.*'
12+
13+
jobs:
14+
greet:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Set LD_VERSION
22+
if: ${{ github.event_name == 'push'}}
23+
run: echo "LD_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
24+
- name: Set LD_VERSION
25+
if: ${{ github.event_name == 'workflow_dispatch'}}
26+
run: echo "LD_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
27+
28+
- name: Set up JDK 11
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 11
32+
33+
- name: Grant execute permission for gradlew
34+
run: chmod +x gradlew
35+
36+
- name: Build the plugin
37+
run: ./gradlew buildPlugin
38+
env:
39+
LD_VERSION: ${{ env.LD_VERSION }}
40+
41+
- name: Verify plugin
42+
id: verify
43+
uses: ChrisCarini/intellij-platform-plugin-verifier-action@v1.0.5
44+
with:
45+
failure-levels: |
46+
INVALID_PLUGIN
47+
ide-versions: |
48+
ideaIC:2021.1
49+
ideaIC:LATEST-EAP-SNAPSHOT
50+
51+
- name: Print verify contents
52+
run: |
53+
echo "The log file path is: ${{steps.verify.outputs.verification-output-log-filename}}" ;
54+
cat ${{steps.verify.outputs.verification-output-log-filename}}
55+
56+
- name: Create Release
57+
id: create_release
58+
uses: actions/create-release@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
tag_name: v${{ env.LD_VERSION }}
63+
release_name: v${{ env.LD_VERSION }}
64+
draft: true
65+
prerelease: false
66+
67+
- name: Upload Release Asset
68+
id: upload-release-asset
69+
uses: actions/upload-release-asset@v1
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
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
74+
asset_path: ./build/distributions/leetcode-editor-${{ env.LD_VERSION }}.zip
75+
asset_name: leetcode-editor-${{ env.LD_VERSION }}.zip
76+
asset_content_type: application/zip

0 commit comments

Comments
 (0)