Skip to content

Commit 5e16fa5

Browse files
committed
Move windows release build to the MSI workflow.
1 parent 9460803 commit 5e16fa5

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

.github/workflows/release-msi.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ jobs:
2626
echo "RELEASE_ID=$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)" >> "$GITHUB_OUTPUT"
2727
- name: Publish for OS
2828
run: dotnet publish SimplestLoadBalancer.csproj -o ./publish/win-${{ matrix.rid }} -c Release -r win-${{ matrix.rid }} /p:Version=${{ steps.get_version.outputs.VERSION }}
29+
- name: Zip it Up
30+
shell: bash
31+
run: zip -r -j SimplestLoadBalancer-${{ github.ref_name }}-${{ matrix.rid }}.zip ./slb-${{ matrix.rid }}
32+
- name: Upload ZIP to Release
33+
shell: bash
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
VERSION: ${{ github.ref_name }}
37+
FILE: SimplestLoadBalancer-${{ github.ref_name }}-${{ matrix.rid }}.zip
38+
URL: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_version.outputs.RELEASE_ID }}/assets?name=SimplestLoadBalancer-${{ github.ref_name }}-${{ matrix.rid }}.zip
39+
run: |
40+
echo $VERSION
41+
echo $URL
42+
AUTH="Authorization: token $GITHUB_TOKEN"
43+
echo $AUTH
44+
curl -sSL -XPOST -H "$AUTH" --upload-file "$FILE" --header "Content-Type:application/octet-stream" --write-out "%{http_code}" --output $(mktemp) "$URL"
2945
- name: Add msbuild to PATH
3046
uses: microsoft/setup-msbuild@v3
3147
- name: Install WiX
@@ -34,14 +50,14 @@ jobs:
3450
wix extension add WixToolset.UI.wixext
3551
wix extension add WixToolset.Firewall.wixext
3652
- name: Build WiX on Windows
37-
run: wix build package.wxs -arch ${{ matrix.rid }} -define Version=${{ steps.get_version.outputs.VERSION }} -define PublishDir=./publish/win-${{ matrix.rid }} -o SimplestLoadBalancer-${{ steps.get_version.outputs.VERSION }}-win-${{ matrix.rid }}.msi -ext WixToolset.UI.wixext -ext WixToolset.Firewall.wixext
53+
run: wix build package.wxs -arch ${{ matrix.rid }} -define Version=${{ github.ref_name }} -define PublishDir=./publish/win-${{ matrix.rid }} -o SimplestLoadBalancer-${{ github.ref_name }}-win-${{ matrix.rid }}.msi -ext WixToolset.UI.wixext -ext WixToolset.Firewall.wixext
3854
- name: Upload MSI to Releaase
3955
shell: bash
4056
env:
4157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
VERSION: ${{ steps.get_version.outputs.VERSION }}
43-
FILE: SimplestLoadBalancer-${{ steps.get_version.outputs.VERSION }}-win-${{ matrix.rid }}.msi
44-
URL: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_version.outputs.RELEASE_ID }}/assets?name=SimplestLoadBalancer-${{ steps.get_version.outputs.VERSION }}-win-${{ matrix.rid }}.msi
58+
VERSION: ${{ github.ref_name }}
59+
FILE: SimplestLoadBalancer-${{ github.ref_name }}-win-${{ matrix.rid }}.msi
60+
URL: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_version.outputs.RELEASE_ID }}/assets?name=SimplestLoadBalancer-${{ github.ref_name }}-win-${{ matrix.rid }}.msi
4561
run: |
4662
echo $VERSION
4763
echo $URL

.github/workflows/release.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
include:
12-
- rid: win-x64
13-
os: windows-latest
1412
- rid: linux-x64
1513
os: ubuntu-latest
1614
- rid: linux-arm
@@ -34,15 +32,15 @@ jobs:
3432
sudo apt-get update
3533
sudo apt-get install -y --fix-missing ${{ matrix.cross_toolchain }}
3634
- name: Publish for OS
37-
run: dotnet publish SimplestLoadBalancer.csproj -o ./slb-${{ matrix.rid }} -c Release -r ${{ matrix.rid }} /p:Version=${{ steps.get_version.outputs.VERSION }}
35+
run: dotnet publish SimplestLoadBalancer.csproj -o ./slb-${{ matrix.rid }} -c Release -r ${{ matrix.rid }} /p:Version=${{ github.ref_name }}
3836
- name: Zip it Up
39-
run: zip -r -j SimplestLoadBalancer-${{ steps.get_version.outputs.VERSION }}-${{ matrix.rid }}.zip ./slb-${{ matrix.rid }}
37+
run: zip -r -j SimplestLoadBalancer-${{ github.ref_name }}-${{ matrix.rid }}.zip ./slb-${{ matrix.rid }}
4038
- name: Upload ZIP to Release
4139
env:
4240
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
VERSION: ${{ steps.get_version.outputs.VERSION }}
44-
FILE: SimplestLoadBalancer-${{ steps.get_version.outputs.VERSION }}-${{ matrix.rid }}.zip
45-
URL: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_version.outputs.RELEASE_ID }}/assets?name=SimplestLoadBalancer-${{ steps.get_version.outputs.VERSION }}-${{ matrix.rid }}.zip
41+
VERSION: ${{ github.ref_name }}
42+
FILE: SimplestLoadBalancer-${{ github.ref_name }}-${{ matrix.rid }}.zip
43+
URL: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_version.outputs.RELEASE_ID }}/assets?name=SimplestLoadBalancer-${{ github.ref_name }}-${{ matrix.rid }}.zip
4644
run: |
4745
echo $VERSION
4846
echo $URL

0 commit comments

Comments
 (0)