Skip to content

Commit

Permalink
Support sha1sum
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Stackflow committed Sep 14, 2024
1 parent 8631264 commit 409db21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ jobs:
mv /tmp/artifacts/release-Linux/*.deb /tmp/artifacts/final/
mv /tmp/artifacts/release-Linux/*.tar.gz /tmp/artifacts/final/
ls -R /tmp/artifacts/final
for file in *; do
if [ -f "$file" ]; then
sha1sum "$file" | awk '{ print $1 }' > "$file.sha1"
fi
done
- name: Upload to S3
uses: Robert-Stackflow/upload-s3-action@master
with:
Expand Down
13 changes: 9 additions & 4 deletions lib/Utils/file_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ class FileUtil {
static ReleaseAsset getWindowsPortableAsset(
String latestVersion, ReleaseItem item) {
var asset = item.assets.firstWhere((element) =>
element.contentType == "application/x-zip-compressed" &&
(element.contentType == "application/x-zip-compressed" ||
element.contentType == "application/zip") &&
element.name.contains("windows") &&
element.name.endsWith(".zip"));
asset.pkgsDownloadUrl = Utils.getDownloadUrl(latestVersion, asset.name);
return asset;
Expand All @@ -496,7 +498,8 @@ class FileUtil {
static ReleaseAsset getWindowsInstallerAsset(
String latestVersion, ReleaseItem item) {
var asset = item.assets.firstWhere((element) =>
element.contentType == "application/x-msdownload" &&
(element.contentType == "application/x-msdownload" ||
element.contentType == "application/x-msdos-program") &&
element.name.endsWith(".exe"));
asset.pkgsDownloadUrl = Utils.getDownloadUrl(latestVersion, asset.name);
return asset;
Expand All @@ -505,7 +508,8 @@ class FileUtil {
static ReleaseAsset getLinuxDebianAsset(
String latestVersion, ReleaseItem item) {
var asset = item.assets.firstWhere((element) =>
element.contentType == "application/vnd.debian.binary-package" &&
(element.contentType == "application/vnd.debian.binary-package" ||
element.contentType == "application/x-debian-package") &&
element.name.endsWith(".deb"));
asset.pkgsDownloadUrl = Utils.getDownloadUrl(latestVersion, asset.name);
return asset;
Expand All @@ -522,7 +526,8 @@ class FileUtil {

static ReleaseAsset getIosIpaAsset(String latestVersion, ReleaseItem item) {
var asset = item.assets.firstWhere((element) =>
element.contentType == "application/octet-stream" &&
(element.contentType == "application/octet-stream" ||
element.contentType == "text/plain") &&
element.name.endsWith(".ipa"));
asset.pkgsDownloadUrl = Utils.getDownloadUrl(latestVersion, asset.name);
return asset;
Expand Down

0 comments on commit 409db21

Please sign in to comment.