-
Notifications
You must be signed in to change notification settings - Fork 150
58 lines (51 loc) · 1.49 KB
/
github-action-build-and-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
name: build-release
run-name: Auto Build And Release YSOMAP
on:
push:
tags:
- 'v*'
jobs:
build_release:
runs-on: ubuntu-22.04
name: build_release
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
- name: build
run: |
mvn clean package -DskipTests
echo "artifactPath=$(pwd)/cli/target" >> $GITHUB_ENV
version=$(cat VERSION)
tag=${GITHUB_REF_NAME}
echo "version=$version" >> $GITHUB_ENV
echo "tag=$tag" >> $GITHUB_ENV
# debug
- run: echo version is ${{ env.version }}
- run: echo tag is ${{ env.tag }}
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: false
release_name: ${{ env.tag }}
tag_name: ${{ env.tag }}
body: ${{ env.version }} auto-generated by github actions
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.artifactPath }}/ysomap.jar
asset_name: ysomap.jar
asset_content_type: application/java-archive