This repository has been archived by the owner on Sep 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
136 lines (113 loc) · 3.8 KB
/
publish_to_mod_io.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Publish to mod.io
on:
workflow_dispatch:
inputs:
update_type:
type: choice
default: feature
description: Update type
required: true
options:
- major
- feature
- bug
- alpha
- beta
- rc
env:
mod_name: MoreLanguages
mod_id: 2843420
jobs:
versions:
name: Parse project versions
runs-on: ubuntu-latest
outputs:
mod_version: ${{ steps.bump_mod_version.outputs.next-version }}
steps:
- uses: actions/checkout@v3
# Loading versioning file
- name: Read versions.txt
id: read_versions_file
uses: juliangruber/read-file-action@v1
with:
path: ./version.txt
# TimberAPI versioning
- id: mod_version
uses: actions-ecosystem/action-regex-match@v2
with:
text: ${{ steps.read_versions_file.outputs.content }}
regex: '(?<=MOD_VERSION=).*'
- id: bump_mod_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ steps.mod_version.outputs.match }}
version-fragment: ${{ github.event.inputs.update_type }}
create_modio_package:
runs-on: ubuntu-latest
needs: [versions]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
- name: Restore dependencies
run: dotnet restore
- name: Find and Replace MOD_VERSION_PLACEHOLDER
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "MOD_VERSION_PLACEHOLDER"
replace: ${{ needs.versions.outputs.mod_version }}
regex: false
- name: Build Mod
run: dotnet build --no-restore --configuration RELEASE -p:Version=${{ needs.versions.outputs.mod_version }}
- name: Upload mod to Artifact
uses: actions/[email protected]
with:
name: Test
path: ./
- name: Create ModFolder folder
run: mkdir ModIoPackage
- name: Copy Mod
run: cp ./bin/RELEASE/netstandard2.1/${{env.mod_name}}.dll ModIoPackage
- name: Copy Package files
run: cp -r Package/* ModIoPackage/
- name: Upload mod to Artifact
uses: actions/[email protected]
with:
name: ${{env.mod_name}}_${{ needs.versions.outputs.mod_version }}
path: ModIoPackage
- name: Zip Release
uses: TheDoctor0/[email protected]
with:
filename: ${{env.mod_name}}_${{ needs.versions.outputs.mod_version }}.zip
path: "./"
directory: ModIoPackage
- name: Test
uses: actions/[email protected]
with:
name: Test
path: ModIoPackage/${{env.mod_name}}_${{ needs.versions.outputs.mod_version }}.zip
- uses: nickelc/[email protected]
with:
token: ${{ secrets.MODIO_TOKEN }}
game: 3659
mod: ${{env.mod_id}}
version: ${{ needs.versions.outputs.mod_version }}
path: ModIoPackage/${{env.mod_name}}_${{ needs.versions.outputs.mod_version }}.zip
active: true
changelog: "-"
update_version:
runs-on: ubuntu-latest
needs: [ versions, create_modio_package ]
steps:
- uses: actions/checkout@v2
- name: Modify mod version
uses: mingjun97/file-regex-replace@v1
with:
regex: '(?<=MOD_VERSION=).*'
replacement: '${{ needs.versions.outputs.mod_version }}'
include: 'version.txt'
- name: Commit updated version
uses: EndBug/add-and-commit@v9
with:
message: "Updated version"
default_author: github_actions