This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (100 loc) · 3.45 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Release ADClock Server
# Controls when the action will run.
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
#
# Download and install all needed
#
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set up Node.js 14.15.1
uses: actions/setup-node@v1
with:
node-version: 14.15.1
- name: Install node modules
working-directory: ./src-frontend
run: npm install
#
# Caching for speedup
#
- name: Gradle Cache
uses: actions/cache@v2.1.4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
#
# Build release
#
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build with Gradle
run: gradle -Pversion="${{ steps.get_version.outputs.VERSION }}" build
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.PACKAGE_TOKEN }}
- name: Check bundle
run: ls ./bundle -l
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: server-artifact
path: ./bundle
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Get latest Artifact
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: server-artifact
path: ./bundle
- name: Check bundle
run: ls ./bundle -l
# Build Changelog by PRs
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: ".github/release-changelog-configuration.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create and publish Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{steps.build_changelog.outputs.changelog}}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: ./bundle/server.jar
asset_name: server.jar
asset_content_type: application/jar