-
Notifications
You must be signed in to change notification settings - Fork 92
68 lines (63 loc) · 2.12 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch
jobs:
build:
name: "Release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short $GITHUB_SHA)"
- name: Install requests
run: |
pip install requests
- uses: actions/setup-java@v2
with:
distribution: 'adopt' # See 'Supported distributions' for available options
java-version: '8'
- run: java -version
- name: Run Build
run: |
python build/main.py
env:
CFAPIKEY: ${{ secrets.CFAPIKEY }}
- id: get-version
uses: actions/github-script@v6
with:
result-encoding: string
script: |
try {
const fs = require('fs')
const jsonString = fs.readFileSync('./manifest.json')
var apps = JSON.parse(jsonString)
return apps.version
} catch(err) {
core.error("Error while reading or parsing the JSON")
core.setFailed(err)
}
- run: echo "${{steps.get-version.outputs.result}}"
- name: Rename file
run: |
mv buildOut/client.zip buildOut/supersymmetry-${{steps.get-version.outputs.result}}.zip
mv buildOut/server.zip buildOut/server-${{steps.get-version.outputs.result}}.zip
rm -f buildOut/client.zip
rm -f buildOut/server.zip
- name: Automatic Releases
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.get-version.outputs.result }}
prerelease: false
title: ${{ steps.get-version.outputs.result }}
files: |
buildOut/supersymmetry-${{steps.get-version.outputs.result}}.zip
buildOut/server-${{steps.get-version.outputs.result}}.zip
buildOut/modlist.html