-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (65 loc) · 1.96 KB
/
build.yaml
File metadata and controls
67 lines (65 loc) · 1.96 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
65
66
67
name: Build
on:
push:
branches:
- main
- github-actions
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1.7.2
- run: dotnet tool install --global tcli --version 0.1.4
- run: dotnet build -c Release .
- run: mkdir dist && cp bin/Release/net46/PeglinCore.dll dist/
- name: Build thunderstore package
run: tcli build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
if-no-files-found: error
prerelease:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
if: github.ref_type == 'tag'
steps:
- uses: actions/checkout@v2
- uses: dawidd6/action-get-tag@v1
id: tag
with:
strip_v: true
- uses: mavrosxristoforos/get-xml-info@1.0
id: csproj
with:
xml-file: PeglinCore.csproj
xpath: //Project/PropertyGroup/Version
- name: Get thunderstore.toml version
run: |
version=$(grep "versionNumber" thunderstore.toml | cut -d" " -f3 | tr -d '"')
echo "toml_version=$version" >> $GITHUB_ENV
- run: |
echo "Validating versions (tag: ${{ steps.tag.outputs.tag }}, csproj: ${{ steps.csproj.outputs.info }}, toml: ${{ env.toml_version }})"
- name: Validate versions
if: steps.tag.outputs.tag != steps.csproj.outputs.info || steps.tag.outputs.tag != env.toml_version
uses: actions/github-script@v3
with:
script: core.setFailed('Release version mismatch!')
- uses: actions/download-artifact@v3
if: success()
with:
name: dist
path: dist/
- name: Prerelease
if: success()
uses: softprops/action-gh-release@v1
with:
files: dist/*
fail_on_unmatched_files: true
draft: true
generate_release_notes: true