Skip to content

Commit 1706ec2

Browse files
committed
Trying to gate specific bits to keep artifacts
1 parent 1c91f36 commit 1706ec2

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

.github/workflows/build-and-test.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454

5555
build-demos:
5656
runs-on: ubuntu-latest
57-
if: startsWith(github.event.ref, 'refs/tags/')
5857
permissions:
5958
pages: write
6059
id-token: write
@@ -70,8 +69,9 @@ jobs:
7069
- name: Build Web Demo
7170
run: dotnet publish -c Release -o demo "${{ env.DemoProject }}"
7271

73-
- name: Rewrite Base Path
72+
- name: Rewrite Base Path For Release
7473
shell: pwsh
74+
if: startsWith(github.event.ref, 'refs/tags/')
7575
run: ((Get-Content -path "demo\wwwroot\index.html" -Raw) -replace '<base href="/" />', '<base href="/OpenRpg/" />') | Set-Content -Path "demo\wwwroot\index.html"
7676

7777
- name: Upload Pages Artifact
@@ -80,12 +80,13 @@ jobs:
8080
path: demo/wwwroot/
8181

8282
- name: Deploy Demo to GitHub Pages
83-
uses: actions/deploy-pages@v4
84-
83+
if: startsWith(github.event.ref, 'refs/tags/')
84+
uses: actions/deploy-pages@v4
8585

8686

8787
build-editor:
8888
runs-on: windows-latest
89+
if: startsWith(github.event.ref, 'refs/tags/')
8990
needs: [build-and-test]
9091
steps:
9192
- uses: actions/checkout@v3
@@ -103,10 +104,22 @@ jobs:
103104
with:
104105
name: editor-app
105106
path: /editor
107+
108+
- name: Compress App
109+
shell: pwsh
110+
if: startsWith(github.event.ref, 'refs/tags/')
111+
run: Compress-Archive -Path "editor/*" -Destination "/editor-${{env.BuildVersion}}.zip"
112+
113+
- name: Upload App Release
114+
uses: alexellis/upload-assets@0.2.2
115+
if: startsWith(github.event.ref, 'refs/tags/')
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
with:
119+
asset_paths: '["/editor-${{env.BuildVersion}}.zip"]'
106120

107121
package-and-release:
108122
runs-on: windows-latest
109-
if: startsWith(github.event.ref, 'refs/tags/')
110123
needs: [build-and-test]
111124
steps:
112125
- uses: actions/checkout@v3
@@ -119,6 +132,13 @@ jobs:
119132

120133
- name: .Net Pack
121134
run: dotnet pack --configuration Release /p:Version=${{ env.BuildVersion }} --no-build ${{ env.SolutionFile }}
135+
136+
- name: Publish Editor Artifact
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: Libraries
140+
path: "**/*.nupkg"
122141

123142
- name: Publish To Nuget
143+
if: startsWith(github.event.ref, 'refs/tags/')
124144
run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)