Skip to content

Commit

Permalink
Merge pull request #191 from cachho/refactor/PostBuild
Browse files Browse the repository at this point in the history
refactor: post build
  • Loading branch information
cachho authored Dec 2, 2024
2 parents 9a995e2 + dd318ba commit 2082925
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ jobs:
fi
- name: Build permissions
run: chmod +x build.sh
run: chmod +x *build.sh

- name: Run build script
run: ./build.sh

- name: Inspect build
run: ./inspect-build.sh

- name: Post Build
run: ./post-build.sh

- name: Upload Chromium zip as artifact
uses: actions/upload-artifact@v3
with:
Expand Down
14 changes: 3 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

#######################################
# Compile to TypeScript Code
#######################################
Expand Down Expand Up @@ -103,19 +105,9 @@ cp temp-manifest-chromium.json build/manifest.json
rm -f temp-manifest.json temp-manifest-v2.json
rm -f temp-manifest-chromium.json temp-manifest-firefox.json

#######################################
# Run Mozilla's Firefox Addons-Linter
#######################################
echo "\n> Running Firefox Addons-Linter..."
npx addons-linter dist/firefox.zip --min-manifest-version 2 --max-manifest-version 3


#######################################
# Report back
#######################################
echo "\nBuild finished"
echo "> build/"
echo "> dist/chromium.zip"
echo "> dist/firefox.zip"
find "dist" -type f -exec stat -c"%s %n" {} \; | awk '{size_in_kb = $1 / 1024; printf("%-10.2f KB %s\n", size_in_kb, $2)}'

# TODO: Validate build
7 changes: 7 additions & 0 deletions inspect-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

#######################################
# Run Mozilla's Firefox Addons-Linter
#######################################
echo "\n> Running Firefox Addons-Linter..."
npx addons-linter dist/firefox.zip --min-manifest-version 2 --max-manifest-version 3
5 changes: 5 additions & 0 deletions post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

echo "> dist/chromium.zip"
echo "> dist/firefox.zip"
find "dist" -type f -exec stat -c"%s %n" {} \; | awk '{size_in_kb = $1 / 1024; printf("%-10.2f KB %s\n", size_in_kb, $2)}'

0 comments on commit 2082925

Please sign in to comment.