-
Notifications
You must be signed in to change notification settings - Fork 11
89 lines (77 loc) · 2.5 KB
/
main.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
name: Publish SporeModder FX Release
on:
workflow_dispatch:
jobs:
trigger_updater:
runs-on: ubuntu-latest
name: Trigger SporeModder-FX Updater Workflow
steps:
- uses: convictional/[email protected]
with:
owner: emd4600
repo: SporeModder-FX-Updater
ref: main
workflow_file_name: main.yml
github_token: ${{ secrets.PAT }}
build_updater:
runs-on: ubuntu-latest
needs: trigger_updater
name: Build Updater
steps:
- name: Checkout SporeModder-FX-Updater
uses: actions/checkout@v4
with:
repository: emd4600/SporeModder-FX-Updater
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Generate release zip
run: zip -r "SporeModder FX.zip" "SporeModder FX"
- name: Copy updater
run: |
cp shade/SporeModderFX.Updater.jar SporeModderFX.Updater.jar
- name: "Upload build: Updater"
uses: actions/[email protected]
with:
name: SporeModder-FX-Release
path: SporeModderFX.Updater.jar
- name: "Upload build: Release"
uses: actions/[email protected]
with:
name: SporeModder-FX-Release
path: "SporeModder FX.zip"
publish_release:
name: Publish Release
needs: build_updater
runs-on: ubuntu-latest
steps:
- name: Checkout SporeModder-FX
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: version_number
run: |
git log $(git describe --tags --abbrev=0)..HEAD --oneline --format=%s > changelog.txt
sed -i -e 's/^/- /' changelog.txt
version=$( bash calculate_new_version.sh )
echo "version=$version" >> $GITHUB_OUTPUT
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: SporeModder-FX-Release
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: SporeModder FX v${{ steps.version_number.outputs.version }}
tag_name: v${{ steps.version_number.outputs.version }}
body_path: changelog.txt
files: |
SporeModderFX.Updater.jar
SporeModder FX.zip