Skip to content

Commit e074ed7

Browse files
committed
add github actions for build release
1 parent 8f4381a commit e074ed7

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Run tests
16+
run: ./gradlew test
17+
- name: Build
18+
run: ./gradlew releaseBundle
19+
- name: Archive build artifacts
20+
uses: actions/upload-artifact@v1
21+
with:
22+
name: dist
23+
path: build/distributions

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Upload Release Asset
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Run tests
16+
run: ./gradlew test
17+
- name: Build
18+
run: ./gradlew releaseBundle
19+
- name: Get tag name
20+
id: get_tag_name
21+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
22+
- name: Create release
23+
id: create_release
24+
uses: actions/create-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
tag_name: ${{ github.ref }}
29+
release_name: Release ${{ github.ref }}
30+
draft: false
31+
prerelease: false
32+
- name: Upload release asset
33+
id: upload-release-asset
34+
uses: actions/upload-release-asset@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
upload_url: ${{ steps.create_release.outputs.upload_url }}
39+
asset_path: ./build/distributions/springExamplePlugin-${{ steps.get_tag_name.outputs.VERSION }}.zip
40+
asset_name: springExamplePlugin-${{ steps.get_tag_name.outputs.VERSION }}.zip
41+
asset_content_type: application/zip
42+

0 commit comments

Comments
 (0)