Skip to content

Commit 4d0e15f

Browse files
authored
Merge pull request #3 from coderpatros/self-contained-webapp
Add self-contained web app binary to release workflow
2 parents 9fcc9ba + 1e5b798 commit 4d0e15f

1 file changed

Lines changed: 70 additions & 1 deletion

File tree

.github/workflows/release-web.yml

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,71 @@ jobs:
5757
- name: Test
5858
run: dotnet test --no-build --verbosity normal
5959

60+
build:
61+
name: Build (${{ matrix.rid }})
62+
needs: [validate, test]
63+
runs-on: ${{ matrix.runner }}
64+
env:
65+
VERSION: ${{ needs.validate.outputs.version }}
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
include:
70+
- rid: linux-x64
71+
runner: ubuntu-latest
72+
archive: tar.gz
73+
- rid: linux-arm64
74+
runner: ubuntu-latest
75+
archive: tar.gz
76+
- rid: osx-x64
77+
runner: macos-latest
78+
archive: tar.gz
79+
- rid: osx-arm64
80+
runner: macos-latest
81+
archive: tar.gz
82+
- rid: win-x64
83+
runner: windows-latest
84+
archive: zip
85+
- rid: win-arm64
86+
runner: windows-latest
87+
archive: zip
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- name: Setup .NET
92+
uses: actions/setup-dotnet@v4
93+
with:
94+
dotnet-version: '8.0.x'
95+
96+
- name: Publish
97+
run: >
98+
dotnet publish src/CoderPatros.Tea.Web/CoderPatros.Tea.Web.csproj
99+
-c Release
100+
-r ${{ matrix.rid }}
101+
--self-contained true
102+
-p:PublishSingleFile=true
103+
-p:DebugType=none
104+
-p:Version=${{ env.VERSION }}
105+
-o ./publish
106+
107+
- name: Archive (tar.gz)
108+
if: matrix.archive == 'tar.gz'
109+
run: tar -czf tea-web-v${{ env.VERSION }}-${{ matrix.rid }}.tar.gz -C ./publish .
110+
111+
- name: Archive (zip)
112+
if: matrix.archive == 'zip'
113+
shell: pwsh
114+
run: Compress-Archive -Path ./publish/* -DestinationPath tea-web-v${{ env.VERSION }}-${{ matrix.rid }}.zip
115+
116+
- name: Upload artifact
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: tea-web-v${{ env.VERSION }}-${{ matrix.rid }}
120+
path: tea-web-v${{ env.VERSION }}-${{ matrix.rid }}.${{ matrix.archive }}
121+
60122
release:
61123
name: Release
62-
needs: [validate, test]
124+
needs: [validate, build]
63125
runs-on: ubuntu-latest
64126
permissions:
65127
contents: write
@@ -68,6 +130,12 @@ jobs:
68130
steps:
69131
- uses: actions/checkout@v4
70132

133+
- name: Download all artifacts
134+
uses: actions/download-artifact@v4
135+
with:
136+
path: ./artifacts
137+
merge-multiple: true
138+
71139
- name: Set up Docker Buildx
72140
uses: docker/setup-buildx-action@v3
73141

@@ -99,3 +167,4 @@ jobs:
99167
tag_name: web/v${{ env.VERSION }}
100168
name: Web v${{ env.VERSION }}
101169
generate_release_notes: true
170+
files: ./artifacts/*

0 commit comments

Comments
 (0)