This repository was archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (71 loc) · 2.13 KB
/
release.yml
File metadata and controls
75 lines (71 loc) · 2.13 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
name: Create Release
on:
push:
tags:
- '[0-9].*'
jobs:
create-dist-zip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: frabert/replace-string-action@v1.1
id: str_replace
with:
pattern: '.+/(.+)'
string: ${{ github.ref }}
replace-with: '$1'
- uses: cschleiden/replace-tokens@v1
with:
files: 'src/main/resources/version.properties'
env:
GIT_SHA: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref }}
APP_VER: ${{ steps.str_replace.outputs.replaced }}
- uses: cschleiden/replace-tokens@v1
with:
files: 'build.gradle'
env:
VERSION: ${{ steps.str_replace.outputs.replaced }}
- name: Build with Gradle
run: /bin/sh ./gradlew test shadowDistZip
- uses: actions/upload-artifact@v2-preview
with:
name: test-results
path: build/reports
- uses: actions/upload-artifact@v2-preview
with:
name: dist
path: build/distributions/*.zip
create-release:
runs-on: ubuntu-latest
needs: create-dist-zip
steps:
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- uses: actions/download-artifact@v1
with:
name: dist
path: dist
- name: get zip name
run: echo "##[set-output name=distfile;]$(ls -1 *.zip)"
working-directory: dist
id: dist_file
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ steps.dist_file.outputs.distfile }}
asset_name: ${{ steps.dist_file.outputs.distfile }}
asset_content_type: application/zip