Skip to content

Commit c5005a0

Browse files
committed
Add workflow to publish prebuilt mwebd.exe as a release asset
1 parent cc9438d commit c5005a0

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release mwebd Windows binary
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
mwebd_version:
7+
description: 'mwebd tag to build (must match _mwebdVersion in tool/build_standalone_mwebd_windows.dart)'
8+
required: true
9+
default: 'v0.1.8'
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build-and-release:
16+
runs-on: windows-latest
17+
defaults:
18+
run:
19+
shell: bash
20+
steps:
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.22'
24+
25+
- name: Clone mwebd
26+
run: git clone https://github.com/ltcmweb/mwebd.git --branch "${{ inputs.mwebd_version }}" mwebd
27+
28+
- name: Build mwebd.exe
29+
working-directory: mwebd
30+
env:
31+
CGO_ENABLED: '1'
32+
run: go build -v -o ../mwebd.exe github.com/ltcmweb/mwebd/cmd/mwebd
33+
34+
- name: Compute sha256
35+
run: sha256sum mwebd.exe | awk '{print $1}' > mwebd.exe.sha256
36+
37+
- name: Publish release
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
GH_REPO: ${{ github.repository }}
41+
run: |
42+
TAG="mwebd-${{ inputs.mwebd_version }}"
43+
if gh release view "$TAG" >/dev/null 2>&1; then
44+
gh release upload "$TAG" mwebd.exe mwebd.exe.sha256 --clobber
45+
else
46+
gh release create "$TAG" \
47+
--title "mwebd ${{ inputs.mwebd_version }} (windows-amd64)" \
48+
--notes "Pre-built Windows binary for ltcmweb/mwebd ${{ inputs.mwebd_version }}, built with native Go on windows-latest. Used by the Stack Wallet Windows build via tool/build_standalone_mwebd_windows.dart --fetch." \
49+
mwebd.exe mwebd.exe.sha256
50+
fi

0 commit comments

Comments
 (0)