-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.6 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
name: Release Server
on:
push:
branches: ["main"]
workflow_dispatch:
env:
url: https://kotlingames.shop
permissions:
contents: read
pages: write
id-token: write
jobs:
release:
permissions: write-all
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: set properties value of server
run: |
setProperty(){
awk -v pat="^$1=" -v value="$1=$2" '{ if ($0 ~ pat) print value; else print $0; }' $3 > $3.tmp
mv $3.tmp $3
}
setProperty "server" "${{ env.url }}" "gradle.properties"
setProperty "version" "v0.0.${{github.run_number}}" "gradle.properties"
- run: git tag ${{github.run_number}}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Buid JS bundle
run: |
./gradlew :client:jsBrowserProductionWebpack
./gradlew :client:linkReleaseExecutableMingwX64
- name: server.zip
run: ./gradlew :server:distZip
- name: release
uses: marvinpinto/action-automatic-releases@latest
with:
title: "Build #${{github.run_number}}"
automatic_release_tag: "${{github.run_number}}"
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: server/build/distributions/server.zip
prerelease: false
- shell: bash
run: |
curl -d "${{ secrets.ADMIN_KEY }}" -X POST ${{ env.url }}/shutdown