Skip to content

Commit 5fb6785

Browse files
committed
create scoop manifest
1 parent b9751d4 commit 5fb6785

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/rust-release.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
cargo build --verbose --release --target ${{ matrix.target }}
7777
$bin="target/${{ matrix.target }}/release/rvimage.exe"
7878
echo "BIN=$bin" >> $env:GITHUB_ENV
79-
79+
8080
- name: Build release binary MacOS
8181
shell: bash
8282
if: matrix.os == 'macos-latest'
@@ -105,10 +105,34 @@ jobs:
105105
echo "ASSET_SUM=$FOLDER.tar.gz.sha256" >> $GITHUB_ENV
106106
fi
107107
108-
- name: Upload release archive
108+
- name: Generate Scoop manifest
109+
if: matrix.os == 'windows-latest'
110+
shell: bash
111+
run: |
112+
version="${{ needs.create-release.outputs.version }}"
113+
bin_url="https://github.com/${{ github.repository }}/releases/download/$version/${{ env.ASSET }}"
114+
bin_hash=$(certutil -hashfile "${{ env.ASSET }}" SHA256 | findstr /v "SHA256")
115+
cat <<EOF > scoop-manifest.json
116+
{
117+
"version": "$version",
118+
"description": "Remote Image Viewer and annotation tool",
119+
"homepage": "https://github.com/${{ github.repository }}",
120+
"license": "MIT",
121+
"architecture": {
122+
"64bit": {
123+
"url": "$bin_url",
124+
"hash": "$bin_hash"
125+
}
126+
},
127+
"bin": "rvimage.exe"
128+
}
129+
EOF
130+
echo "SCOOP_MANIFEST=scoop-manifest.json" >> $GITHUB_ENV
131+
132+
- name: Upload release archive and Scoop manifest
109133
env:
110134
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111135
shell: bash
112136
run: |
113137
version="${{ needs.create-release.outputs.version }}"
114-
gh release upload "$version" ${{ env.ASSET }} ${{ env.ASSET_SUM }}
138+
gh release upload "$version" ${{ env.ASSET }} ${{ env.ASSET_SUM }} ${{ env.SCOOP_MANIFEST }}

0 commit comments

Comments
 (0)