Skip to content

Commit

Permalink
More build tooling, yay...
Browse files Browse the repository at this point in the history
  • Loading branch information
SirStendec committed Oct 7, 2024
1 parent 99a0ed3 commit 3032f6d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:
- name: Calculate and Log Version
run: |
./scripts/calculate-version.sh
cat ffz_env >> $GITHUB_ENV
cat .env >> $GITHUB_ENV
- name: Make a Source Artifact for Firefox
id: source-upload-step
uses: actions/upload-artifact@v4
with:
name: source
include-hidden-files: true
path: |
client/*
addons/*
Expand Down
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,46 +29,42 @@ How to Build
git clone https://github.com/FrankerFaceZ/FrankerFaceZ.git client
git clone https://github.com/FrankerFaceZ/Add-Ons.git addons
```
3. Load the environment variables with the calculated version. If you
had to clone the repositories with git, you'll need to run the script
to calculate them instead.
If you downloaded a source archive, run this command:
```bash
source ffz_env
```
If you had to clone the repositories, run this command:
3. If you had to download the code via git clone, run these commands to
calculate the correct version:
```bash
chmod +x scripts/calculate-version.sh
./scripts/calculate-version.sh
```
4. Build the main client.
4. Run this command to load the appropriate environmental variables:
```bash
source ffz_env
```
5. Build the main client.
```bash
cd client
pnpm install
FFZ_EXTENSION=true pnpm build
cd ..
```
5. Build the add-ons.
6. Build the add-ons.
```bash
cd addons
pnpm install
FFZ_EXTENSION=true pnpm build
cd ..
```
5. Ensure you don't have a `dist` folder. Delete it if you do with:
7. Ensure you don't have a `dist` folder. Delete it if you do with:
```bash
rm -rf dist
```
6. Copy the build output from steps 4 and 5 into the dist folder:
8. Copy the build output from steps 5 and 6 into the `dist` folder:
```bash
chmod +x scripts/copy-output.sh
./scripts/copy-output.sh
```
7. Update the version in the manifest.
9. Update the version in the manifest.
```bash
node scripts/update-manifest.js
```
8. Find the unpacked extension in the `dist` folder.
9. Optionally, zip the contents of the `dist` as suits your needs.
10. Find the unpacked extension in the `dist` folder.
11. Optionally, zip the contents of the `dist` as suits your needs.
14 changes: 10 additions & 4 deletions scripts/calculate-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ echo "Build Version: $BUILD"
echo "Commit: $ADDONS_COMMIT"

# Export our environmental variables
echo "CLIENT_COMMIT=$CLIENT_COMMIT" >> ffz_env
echo "FFZ_VERSION=$VERSION" >> ffz_env
echo "ADDONS_COMMIT=$ADDONS_COMMIT" >> ffz_env
echo "FFZ_BUILD=$BUILD" >> ffz_env
echo "CLIENT_COMMIT=$CLIENT_COMMIT" >> .env
echo "FFZ_VERSION=$VERSION" >> .env
echo "ADDONS_COMMIT=$ADDONS_COMMIT" >> .env
echo "FFZ_BUILD=$BUILD" >> .env

# Export our environmental variables (for the source archive)
echo "export CLIENT_COMMIT=$CLIENT_COMMIT" >> ffz_env
echo "export FFZ_VERSION=$VERSION" >> ffz_env
echo "export ADDONS_COMMIT=$ADDONS_COMMIT" >> ffz_env
echo "export FFZ_BUILD=$BUILD" >> ffz_env

0 comments on commit 3032f6d

Please sign in to comment.