This repository has been archived by the owner on Dec 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
121 lines (106 loc) · 4.12 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
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
name: CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Create Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
git-message: 'chore(release): {version}'
git-user-name: 'Conventional Changelog Action'
git-user-email: '[email protected]'
preset: 'angular'
tag-prefix: 'v'
output-file: 'CHANGELOG.md'
release-count: '10'
version-file: './manifest.json'
version-path: 'version_number'
skip-on-empty: 'true'
skip-version-file: 'false'
skip-commit: 'false'
- name: Read Config
if: ${{ steps.changelog.outputs.skipped == 'false' }}
id: config
uses: juliojimenez/yamler@v0
with:
yaml-file: unex.yml
- name: Setup Variables
if: ${{ steps.changelog.outputs.skipped == 'false' }}
id: vars
run: |
echo ::set-output name=artifact::Plugin_release_${{ steps.changelog.outputs.tag }}.zip
echo ::set-output name=filename::${{ steps.config.outputs.filename }}.dll
echo ::set-output name=solution::${{ steps.config.outputs.filename }}.sln
echo ::set-output name=modid::${{ steps.config.outputs.modid }}
- name: Setup dotnet for NexusMod release
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Setup dotnet for build
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: actions/[email protected]
with:
dotnet-version: 5.0.x
- name: Setup Unity
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: kuler90/[email protected]
with:
unity-version: 2019.4.20f1
- name: Activate Unity
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: kuler90/activate-unity@v1
with:
unity-username: ${{ secrets.UNITY_LOGIN }}
unity-password: ${{ secrets.UNITY_PASSWORD }}
unity-authenticator-key: ${{ secrets.UNITY_AUTHENTICATOR_KEY }}
- name: Restore tools
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: dotnet tool restore
- name: Build and Create the package
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: dotnet build ${{ steps.vars.outputs.solution }} -c Release
- name: Zip
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
mkdir output
mkdir output/plugins
cp Plugin/bin/Release/${{ steps.vars.outputs.filename }} output/plugins
- uses: papeloto/action-zip@v1
with:
files: output/ icon.png manifest.json README.md
dest: ${{ steps.vars.outputs.artifact }}
- name: Create GH Release
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.changelog.outputs.tag }}
name: Valheim Plugin ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
artifacts: ${{ steps.vars.outputs.artifact }}
token: ${{ secrets.github_token }}
- name: Upload to NexusMods
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: >
dotnet unex upload
${{ steps.vars.outputs.modid }}
${{ steps.vars.outputs.artifact }}
-v ${{ steps.changelog.outputs.version }}
dotnet unex changelog
${{ steps.vars.outputs.version }}
"$CHANGELOG_BODY"
-m ${{ steps.vars.outputs.modid }}
env:
UNEX_DEBUG: true
UNEX_APIKEY: ${{ secrets.UNEX_API_KEY }}
UNEX_COOKIES: ${{ secrets.UNEX_COOKIES }}
CHANGELOG_BODY: "${{ steps.changelog.outputs.clean_changelog }}"