-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (121 loc) · 4.48 KB
/
release.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Release
on:
release:
types: [ published, edited ]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
godot: [ 4.2.2-stable ]
os: [ windows-latest, ubuntu-latest, macOS-latest ]
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # SDK Version to use
- name: .Net Core Info
run: dotnet --info
- name: Run Unit Tests
run: dotnet test
godot:
needs: [ test ]
name: Upload Binaries
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
godot: [ '4.2.2-stable' ]
os: [ 'windows-latest' ]
platform: [ 'Windows x64' ]
steps:
- name: Checkout Code
uses: actions/checkout@master
with:
lfs: true
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # SDK Version to use
- name: Download Godot
run: curl https://github.com/godotengine/godot-builds/releases/download/${{ matrix.godot }}/Godot_v${{ matrix.godot }}_mono_win64.zip -o godot.zip; curl https://github.com/godotengine/godot-builds/releases/download/${{ matrix.godot }}/Godot_v${{ matrix.godot }}_mono_export_templates.tpz -o godot_export_templates.tpz
- name: Extract Godot
run: Expand-Archive -Path godot.zip -DestinationPath Godot; Rename-Item Godot/Godot_v${{ matrix.godot }}_mono_win64 -NewName Engine; Rename-Item Godot/Engine/Godot_v${{ matrix.godot }}_mono_win64.exe -NewName "godot.exe"; Rename-Item Godot/Engine/Godot_v${{ matrix.godot }}_mono_win64_console.exe -NewName "godot_console.exe"
- name: Extract Build Templates
run: echo 1
- name: Build Binary
run: New-Item -Force -Path "./bin/${{ matrix.platform }}" -ItemType "directory"; ./Godot/Engine/godot_console.exe --build-solutions --export-release ${{ matrix.platform }} ../bin/${{ matrix.platform }}/BlazorBoy.exe ./Gameboy.Player.Godot/project.godot
cli:
needs: [ test ]
name: Publish Nuget
permissions:
packages: write
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
dotnet: [ '8.0.x' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@master
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '${{ matrix.dotnet }}' # SDK Version to use
- name: Pack Nuget Package
env:
# Work around https://github.com/actions/setup-dotnet/issues/29
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
run: dotnet pack Gameboy.Player.Cli --configuration Release --output nupkg
- name: Publish Nuget Package
env:
# Work around https://github.com/actions/setup-dotnet/issues/29
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push nupkg\*.nupkg --source "https://nuget.pkg.github.com/qkmaxware/index.json" --skip-duplicate --api-key $Env:GITHUB_TOKEN
blazor:
name: Deploy Github Pages
needs: [ test ]
permissions:
packages: read
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@master
with:
submodules: "recursive"
fetch-depth: 0
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # SDK Version to use
- name: Testing
run: dotnet test Gameboy.Test
- name: Change base-tag
run: sed -i 's/<base href="\/" \/>/<base href="\/BlazorBoy\/" \/>/g' Gameboy.Player.Blazor/wwwroot/index.html
- name: Restore Packages
env:
GITHUB_USERNAME: qkmaxware
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet restore
- name: Build Site
env:
GITHUB_USERNAME: qkmaxware
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet publish Gameboy.Player.Blazor -c Release -o .site
- name: Add .nojekyll file
run: touch .site/wwwroot/.nojekyll
- name: Custom 404
run: cp .site/wwwroot/index.html .site/wwwroot/404.html
- name: Commit to Github Pages
uses: JamesIves/[email protected]
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: .site/wwwroot