Skip to content

Commit 782db08

Browse files
committed
add cd gh actions
1 parent 83e6ca4 commit 782db08

2 files changed

Lines changed: 108 additions & 0 deletions

File tree

.github/workflows/core-cd.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Core CD
2+
3+
on:
4+
push:
5+
tags: '*'
6+
7+
jobs:
8+
release-nuget:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: '6.x'
15+
16+
- name: Fetch version
17+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
18+
19+
- name: Restore packages
20+
run: dotnet restore Core/FEZRepacker.Core.csproj
21+
22+
- name: Build
23+
run: dotnet build Core/FEZRepacker.Core.csproj -c Release /p:Version=${VERSION}
24+
25+
- name: Pack
26+
run: dotnet pack Core/FEZRepacker.Core.csproj -c Release /p:Version=${VERSION} --no-build --output .
27+
28+
- name: Push
29+
run: dotnet nuget push FEZRepacker.Core.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Interface CD
2+
3+
on:
4+
push:
5+
tags: '*'
6+
7+
jobs:
8+
build-interface:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: '6.x'
15+
16+
- name: Restore packages
17+
run: dotnet restore Interface/FEZRepacker.Interface.csproj
18+
19+
- name: Build for Windows
20+
run: dotnet publish Interface/FEZRepacker.Interface.csproj -c Release -r win-x86 --self-contained
21+
22+
- name: Build for Linux
23+
run: dotnet publish Interface/FEZRepacker.Interface.csproj -c Release -r linux-arm64 --self-contained
24+
25+
- name: Upload Windows artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: FEZRepacker.Interface.Windows
29+
path: Interface/bin/Release/net6.0/win-x86/publish/FEZRepacker.Interface.exe
30+
if-no-files-found: error
31+
32+
- name: Upload Linux artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: FEZRepacker.Interface.Linux
36+
path: Interface/bin/Release/net6.0/linux-arm64/publish/FEZRepacker.Interface
37+
if-no-files-found: error
38+
release:
39+
if: github.repository == 'FEZModding/FEZRepacker'
40+
needs: [build-interface]
41+
runs-on: ubuntu-latest
42+
steps:
43+
44+
- name: Download Linux Build
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: FEZRepacker.Interface.Linux
48+
- name: Rename Linux Build
49+
run: mv FEZRepacker.Interface FEZRepacker
50+
51+
- name: Download Windows Build
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: FEZRepacker.Interface.Windows
55+
- name: Rename Windows Build
56+
run: mv FEZRepacker.Interface.exe FEZRepacker.exe
57+
58+
- name: Create Release
59+
uses: softprops/action-gh-release@v1
60+
with:
61+
body: |
62+
## Usage
63+
64+
Download one of the following:
65+
66+
- `FEZRepacker.exe` - Windows standalone command-line interface
67+
- `FEZRepacker` - Linux standalone command-line interface
68+
69+
...and consult the README.md for usage details.
70+
71+
Additionally, Core library can be accessed as a NuGet package: https://www.nuget.org/packages/FEZRepacker.Core
72+
73+
## Changelog
74+
75+
TODO
76+
files: |
77+
FEZRepacker.exe
78+
FEZRepacker
79+
fail_on_unmatched_files: true

0 commit comments

Comments
 (0)