-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.86 KB
/
publish-release.yml
File metadata and controls
64 lines (55 loc) · 1.86 KB
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
name: Publish Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c "ExportRelease"
- name: Zip
run: cd bin &&
zip -r ../CustomCardTextureLoader.zip ./CustomCardTextureLoader/*
- name: Extract latest changelog section
id: changelog
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
BODY=$(awk -v ver="$VERSION" '
$0 ~ "^"ver":" {flag=1; next}
flag && /^[0-9]+\.[0-9]+\.[0-9]+:/ {flag=0}
flag {print}
' CHANGELOG.md)
BODY="$(echo "$BODY" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
files: CustomCardTextureLoader.zip
fail_on_unmatched_files: true
body: ${{ steps.changelog.outputs.body }}
- name: Upload to NexusMods
uses: Nexus-Mods/upload-action@main
with:
api_key: ${{ secrets.NEXUSMODS_API_KEY }}
file_group_id: ${{ vars.NEXUSMODS_FILE_GROUP_ID }}
filename: CustomCardTextureLoader.zip
version: ${{ github.ref_name }}
display_name: CustomCardTextureLoader
description: ${{ steps.changelog.outputs.body }}
file_category: main
primary_mod_manager_download: true
allow_mod_manager_download: true