Skip to content

Commit e9cd7e5

Browse files
committed
Separate workflows
1 parent c435a29 commit e9cd7e5

4 files changed

Lines changed: 89 additions & 83 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Thunderstore
2+
on:
3+
push:
4+
branches: [main]
5+
6+
env:
7+
DOTNET_CLI_TELEMETRY_OPTOUT: true
8+
MSBUILDTERMINALLOGGER: false
9+
DOTNET_VERSION: 9.0.x
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: read
18+
if: ${{ github.event_name == 'push' }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 0
24+
filter: tree:0
25+
- name: Setup dotnet
26+
uses: actions/setup-dotnet@v5
27+
with:
28+
dotnet-version: ${{ env.DOTNET_VERSION }}
29+
- name: Login to GitHub Packages
30+
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ github.token }} --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --store-password-in-clear-text
31+
- id: build
32+
name: Build project
33+
run: |
34+
dotnet build -c Release
35+
FILE=$(find ${{ github.workspace }}/artifacts/thunderstore -type f -name "*.zip" | head -n 1)
36+
[ -n "$FILE" ] || { echo "Artifact not found!"; exit 1; }
37+
echo "file=$FILE" >> "$GITHUB_OUTPUT"
38+
- name: Upload artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
path: ${{ steps.build.outputs.file }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Thunderstore
2+
on:
3+
release:
4+
types: released
5+
6+
env:
7+
DOTNET_CLI_TELEMETRY_OPTOUT: true
8+
MSBUILDTERMINALLOGGER: false
9+
DOTNET_VERSION: 9.0.x
10+
11+
jobs:
12+
publish:
13+
name: Publish
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: read
18+
if: ${{ github.event_name == 'release' && github.action == 'released' }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
with:
23+
ref: ${{ github.event.release.tag_name }}
24+
fetch-depth: 0
25+
filter: tree:0
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v5
28+
with:
29+
dotnet-version: ${{ env.DOTNET_VERSION }}
30+
- name: Login to GitHub Packages
31+
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ github.token }} --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --store-password-in-clear-text
32+
- id: build
33+
name: Build and publish
34+
run: |
35+
dotnet build -c Release -target:PublishTS
36+
FILE=$(find ${{ github.workspace }}/artifacts/thunderstore -type f -name "*.zip" | head -n 1)
37+
[ -n "$FILE" ] || { echo "Artifact not found!"; exit 1; }
38+
echo "file=$FILE" >> "$GITHUB_OUTPUT"
39+
- name: Upload artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
path: ${{ steps.build.outputs.file }}

.github/workflows/thunderstore.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

CustomizableName.sln

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{6B14
1616
README.md = README.md
1717
EndProjectSection
1818
EndProject
19+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
20+
ProjectSection(SolutionItems) = preProject
21+
.github\workflows\thunderstore-publish.yml = .github\workflows\thunderstore-publish.yml
22+
.github\workflows\thunderstore-build.yml = .github\workflows\thunderstore-build.yml
23+
EndProjectSection
24+
EndProject
1925
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
2026
ProjectSection(SolutionItems) = preProject
2127
Config.Build.user.props = Config.Build.user.props
@@ -24,11 +30,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configurat
2430
Directory.Build.targets = Directory.Build.targets
2531
EndProjectSection
2632
EndProject
27-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
28-
ProjectSection(SolutionItems) = preProject
29-
.github\workflows\thunderstore.yml = .github\workflows\thunderstore.yml
30-
EndProjectSection
31-
EndProject
3233
Global
3334
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3435
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)