Skip to content

Commit d9c696e

Browse files
committed
Added AOT Compilation to Release Pipeline
1 parent 7ea7cc6 commit d9c696e

File tree

1 file changed

+116
-44
lines changed

1 file changed

+116
-44
lines changed

.github/workflows/release.yml

Lines changed: 116 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,119 @@ jobs:
1111
permissions:
1212
contents: write
1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
with:
17-
show-progress: false
18-
19-
- name: Install .NET
20-
uses: actions/setup-dotnet@v4
21-
with:
22-
dotnet-version: |
23-
8.x
24-
9.x
25-
26-
- name: Get the version
27-
id: get_version
28-
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
29-
30-
- name: Build Packages
31-
run: |
32-
./build.sh pack --SemVersion ${{ env.GIT_TAG }} --Configuration Release
33-
34-
- name: Push Packages
35-
run: |
36-
./build.cmd publish --skip
37-
env:
38-
NuGetApiKey: ${{ secrets.NUGETAPIKEY }}
39-
40-
- name: Get release
41-
id: get_release
42-
run: |
43-
RELEASE_ID=$(gh api repos/ChilliCream/graphql-platform/releases/tags/${{ env.GIT_TAG }} --jq '.id')
44-
UPLOAD_URL=$(gh api repos/ChilliCream/graphql-platform/releases/$RELEASE_ID --jq '.upload_url')
45-
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
46-
echo "UPLOAD_URL=${UPLOAD_URL}" >> $GITHUB_ENV
47-
env:
48-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
50-
- name: Upload Release Assets
51-
run: |
52-
for file in ./output/packages/*.nupkg; do
53-
echo "Uploading $file"
54-
gh release upload ${{ env.GIT_TAG }} "$file" --repo ChilliCream/graphql-platform
55-
done
56-
env:
57-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
show-progress: false
18+
19+
- name: Install .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: |
23+
8.x
24+
9.x
25+
26+
- name: Get the version
27+
id: get_version
28+
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
29+
30+
- name: Build Packages
31+
run: |
32+
./build.sh pack --SemVersion ${{ env.GIT_TAG }} --Configuration Release
33+
34+
- name: Push Packages
35+
run: |
36+
./build.cmd publish --skip
37+
env:
38+
NuGetApiKey: ${{ secrets.NUGETAPIKEY }}
39+
40+
- name: Get release
41+
id: get_release
42+
run: |
43+
RELEASE_ID=$(gh api repos/ChilliCream/graphql-platform/releases/tags/${{ env.GIT_TAG }} --jq '.id')
44+
UPLOAD_URL=$(gh api repos/ChilliCream/graphql-platform/releases/$RELEASE_ID --jq '.upload_url')
45+
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
46+
echo "UPLOAD_URL=${UPLOAD_URL}" >> $GITHUB_ENV
47+
env:
48+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Upload Release Assets
51+
run: |
52+
for file in ./output/packages/*.nupkg; do
53+
echo "Uploading $file"
54+
gh release upload ${{ env.GIT_TAG }} "$file" --repo ChilliCream/graphql-platform
55+
done
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
build-aot:
60+
name: Build AOT Binary
61+
runs-on: ${{ matrix.os }}
62+
needs: release
63+
strategy:
64+
matrix:
65+
include:
66+
# Linux
67+
- os: ubuntu-22.04
68+
rid: linux-x64
69+
ext: ""
70+
- os: ubuntu-22.04
71+
rid: linux-arm
72+
ext: ""
73+
- os: ubuntu-22.04
74+
rid: linux-arm64
75+
ext: ""
76+
- os: ubuntu-22.04
77+
rid: linux-musl-x64
78+
ext: ""
79+
- os: ubuntu-22.04
80+
rid: linux-musl-arm64
81+
ext: ""
82+
# macOS
83+
- os: macos-14
84+
rid: osx-x64
85+
ext: ""
86+
- os: macos-14
87+
rid: osx-arm64
88+
ext: ""
89+
# Windows
90+
- os: windows-2022
91+
rid: win-x64
92+
ext: ".exe"
93+
- os: windows-2022
94+
rid: win-x86
95+
ext: ".exe"
96+
- os: windows-2022
97+
rid: win-arm64
98+
ext: ".exe"
99+
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@v4
103+
104+
- name: Install .NET
105+
uses: actions/setup-dotnet@v4
106+
with:
107+
dotnet-version: 9.x
108+
109+
- name: Publish AOT binary
110+
run: |
111+
dotnet publish ./src/HotChocolate/Fusion-vnext/src/Fusion.CommandLine \
112+
-c Release \
113+
-r ${{ matrix.rid }} \
114+
-f net9.0 \
115+
--self-contained true \
116+
-p:PublishAot=true \
117+
-p:TargetFrameworks=NET9.0 \
118+
-o ./publish
119+
120+
- name: Zip the binary
121+
run: |
122+
cd publish
123+
zip ../fusion-${{ matrix.rid }}.zip fusion${{ matrix.ext }}
124+
125+
- name: Upload zipped binary to GitHub Release
126+
run: |
127+
gh release upload ${{ github.ref_name }} fusion-${{ matrix.rid }}.zip --repo ${{ github.repository }}
128+
env:
129+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)