-
-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (55 loc) · 1.99 KB
/
build.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
name: Build
on:
workflow_dispatch:
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Restore dependencies
run: dotnet restore
- name: Install xmllint
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: Extract Version from .csproj
id: extract_version
run: |
version=$(xmllint --xpath "string(//Project/PropertyGroup/Version)" Bloodcraft.csproj)
echo "version=$version" >> $GITHUB_ENV
- name: Update thunderstore.toml
run: |
sed -i "s/versionNumber = \".*\"/versionNumber = \"${{ env.version }}\"/" thunderstore.toml
- name: Create secrets.json
run: |
mkdir -p /home/runner/work/Bloodcraft/Bloodcraft/Resources
echo '{
"NEW_SHARED_KEY": "${{ secrets.NEW_SHARED_KEY }}",
"OLD_SHARED_KEY": "${{ secrets.OLD_SHARED_KEY }}"
}' > /home/runner/work/Bloodcraft/Bloodcraft/Resources/secrets.json
- name: Build (Release)
run: dotnet build . --configuration Release -p:Version=${{ env.version }}
- name: Clean Up
run: rm /home/runner/work/Bloodcraft/Bloodcraft/Resources/secrets.json
- name: GH Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'workflow_dispatch'
with:
body: Manual pre-release of ${{ env.version }}
name: v${{ env.version }}
fail_on_unmatched_files: true
prerelease: true
tag_name: v${{ env.version }}
files: |
./bin/Release/net6.0/Bloodcraft.dll
CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}