diff --git a/.github/workflows/manual-generate-zip.yml b/.github/workflows/manual-generate-zip.yml index 2f6bb54..d7c536c 100644 --- a/.github/workflows/manual-generate-zip.yml +++ b/.github/workflows/manual-generate-zip.yml @@ -15,13 +15,8 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - - name: Build with Ant - run: ant -noinput -buildfile build.xml + - name: Build with build.sh + run: ./build.sh - name: Setting date and time in env variable run: echo "date-time-env=$(date '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/pr-zip-generate.yml b/.github/workflows/pr-zip-generate.yml index d16f50a..5b6b83c 100644 --- a/.github/workflows/pr-zip-generate.yml +++ b/.github/workflows/pr-zip-generate.yml @@ -15,13 +15,8 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - - name: Build with Ant - run: ant -noinput -buildfile build.xml + - name: Build with build.sh + run: ./build.sh - name: Setting date and time in env variable run: echo "date-time-env=$(date '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/release-zip-upload.yml b/.github/workflows/release-zip-upload.yml index 71147fc..a7b12d6 100644 --- a/.github/workflows/release-zip-upload.yml +++ b/.github/workflows/release-zip-upload.yml @@ -15,13 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - - name: Build with Ant - run: ant -noinput -buildfile build.xml + - name: Build with build.sh + run: ./build.sh - name: rename zips with version run: | mv -- generated/chrome-stt.zip generated/chrome-stt-${{ github.ref_name }}.zip diff --git a/README.md b/README.md index 25477f2..e2b152f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Scroll to top and vice versa in a desktop browser. A browser extension for Chrom ## How to Run: - The `src` folder contains all the code to be used in any Chromium browsers to load as a temporary extension. - To debug for Firefox, use the `firefox` folder in the `generated` folder. - - You'll have to run `ant` to generate the `generated` folder. + - You'll have to run `./build.sh` to generate the `generated` folder. ## Bookmarklet If someone does not like installing an extension. Then you can create this Bookmark in your bookmark toolbar. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..85bc742 --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +GENERATED=generated + +echo "Cleaning $GENERATED folder" +rm -rf $GENERATED +mkdir -p $GENERATED + +echo "Building for Chrome" +cd src +zip -rq ../$GENERATED/chrome-stt.zip * -x "*.DS_Store" +cd .. + +echo "Building for Firefox" +FIREFOX=$GENERATED/firefox +mkdir -p $FIREFOX +echo "Copying src to $FIREFOX folder" +cp -r src/. $FIREFOX/ + +echo "Manipulating files" +cd $FIREFOX +rm -f manifest.json +cp ../../resources/manifest-ff-v2.json manifest.json +sed -i '' -e 's/chrome.action./chrome.browserAction./g' background.js + +zip -rq ../firefox-stt.zip * -x "*.DS_Store" +cd ../.. +echo "Build Completed" diff --git a/build.xml b/build.xml deleted file mode 100644 index 4596081..0000000 --- a/build.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/htmlModifier-2.1.jar b/resources/htmlModifier-2.1.jar deleted file mode 100644 index ed17d38..0000000 Binary files a/resources/htmlModifier-2.1.jar and /dev/null differ diff --git a/src/manifest-ff-v2.json b/resources/manifest-ff-v2.json similarity index 100% rename from src/manifest-ff-v2.json rename to resources/manifest-ff-v2.json