This repository was archived by the owner on Oct 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 1.49 KB
/
Copy pathbuild.yml
File metadata and controls
53 lines (51 loc) · 1.49 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
name: Build
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
jar:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build jar
run: mvn clean install -B -V
- name: Create deploy directory
run: mkdir deploy
if: startsWith(github.ref, 'refs/tags/v')
- name: Copy jar to deploy dir
run: cp -v "target/$(ls target | grep jar-with-dependencies)" deploy
if: startsWith(github.ref, 'refs/tags/v')
- name: Compress release
run: zip -r "cleanfoot.jar.zip" "deploy"
if: startsWith(github.ref, 'refs/tags/v')
- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cleanfoot.jar.zip
asset_name: cleanfoot.jar.zip
asset_content_type: application/zip