Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the release-build process in GitHub Actions #525

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: sh ./install-deps.sh
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install Dependencies
run: sh ./install-deps.sh
- name: Install Node Modules
run: make node_modules
- name: Check Types
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/test-release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test-release-build

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install Dependencies
run: sh ./install-deps.sh
- name: Make a Temporary Version Number (if needed)
run: |
if [ -z "$(git tag --points-at=HEAD)" ]; then
node -e "x=`cat assets/manifest.json`; x.version='9999.99.9999'; console.log(JSON.stringify(x))" >assets/manifest.json.new
mv assets/manifest.json.new assets/manifest.json
make fix-style
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git commit -m 'Make a temporary version number' assets/manifest.json
fi
- name: Try Building Release Artifacts
run: make rel
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ rel:
rel-inner:
$(MAKE) pkg-webext pkg-source
$(MAKE) -C $(RELEASE_DIR)/$(SRCPKG_DIR) release-tag pkg-webext pkg-source
[ -z "$$(diff -Nru dist $(RELEASE_DIR)/$(SRCPKG_DIR)/dist)" ]
@if [ ! -z "$$(diff -Nru dist $(RELEASE_DIR)/$(SRCPKG_DIR)/dist)" ]; then \
diff -Nru dist $(RELEASE_DIR)/$(SRCPKG_DIR)/dist; \
echo "!!!" >&2; \
echo "!!! Build did not reproduce correctly; check diff output above" >&2; \
echo "!!!" >&2; \
exit 1; \
fi
rm -rf $(RELEASE_DIR)/$(SRCPKG_DIR)
@echo ""
@echo "Ready for release $(VERSION)!"
Expand Down Expand Up @@ -198,8 +204,9 @@ site:
## Cleanup

distclean: clean
rm -rf node_modules $(RELEASE_DIR)/$(SRCPKG_DIR) $(SRC_PKG) $(DIST_PKG)
rm -rf docs/vendor
rm -rf node_modules docs/vendor \
$(RELEASE_DIR)/$(SRCPKG_DIR) $(SRC_PKG) $(DIST_PKG) \
releases/*-dirty* releases/*-dev*
.PHONY: distclean

clean:
Expand Down
3 changes: 3 additions & 0 deletions install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ deps_apt() {

sudo apt-get update
sudo apt-get install -y nodejs

elif [ "$(node --version |cut -c2-3)" -lt $NODE_VERSION ]; then
die "Please upgrade Node.js to v$NODE_VERSION or later (you have $(node --version))."
fi
}

Expand Down
Loading