File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 3838 args : release --rm-dist
3939 env :
4040 GITHUB_TOKEN : ${{ secrets.GH_PUBLISH_SECRETS }}
41+
42+ msi :
43+ needs : goreleaser
44+ runs-on : windows-latest
45+ steps :
46+ - name : Checkout
47+ uses : actions/checkout@v2
48+ - name : Download hd.exe
49+ id : download_exe
50+ shell : bash
51+ run : |
52+ hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_amd64*.zip'
53+ printf "::set-output name=zip::%s\n" *.zip
54+ unzip -o *.zip && rm -v *.zip
55+ env :
56+ GITHUB_TOKEN : ${{secrets.GH_PUBLISH_SECRETS}}
57+ - name : Install go-msi
58+ run : choco install -y "go-msi"
59+ - name : Prepare PATH
60+ shell : bash
61+ run : |
62+ echo "$WIX\\bin" >> $GITHUB_PATH
63+ echo "C:\\Program Files\\go-msi" >> $GITHUB_PATH
64+ - name : Build MSI
65+ id : buildmsi
66+ shell : bash
67+ env :
68+ ZIP_FILE : ${{ steps.download_exe.outputs.zip }}
69+ run : |
70+ mkdir -p build
71+ msi="$(basename "$ZIP_FILE" ".zip").msi"
72+ printf "::set-output name=msi::%s\n" "$msi"
73+ go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version "${GITHUB_REF#refs/tags/}"
74+ - name : Upload MSI
75+ shell : bash
76+ run : |
77+ tag_name="${GITHUB_REF#refs/tags/}"
78+ hub release edit "$tag_name" -m "" -a "$MSI_FILE"
79+ release_url="$(gh api repos/:owner/:repo/releases -q ".[]|select(.tag_name==\"${tag_name}\")|.url")"
80+ publish_args=( -F draft=false )
81+ if [[ $GITHUB_REF != *-* ]]; then
82+ publish_args+=( -f discussion_category_name="$DISCUSSION_CATEGORY" )
83+ fi
84+ gh api -X PATCH "$release_url" "${publish_args[@]}"
85+ env :
86+ MSI_FILE : ${{ steps.buildmsi.outputs.msi }}
87+ DISCUSSION_CATEGORY : General
88+ GITHUB_TOKEN : ${{secrets.GH_PUBLISH_SECRETS}}
You can’t perform that action at this time.
0 commit comments