-
Notifications
You must be signed in to change notification settings - Fork 0
Update make release for PR-only workflow #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .node-version | ||
|
|
||
| - run: npm ci | ||
|
|
||
| - name: Lint | ||
| run: npx eslint *.js | ||
|
|
||
| - name: Test | ||
| run: npm test | ||
|
|
||
| - name: Build Chrome zip | ||
| run: make build | ||
|
|
||
| - name: Build Firefox xpi | ||
| run: | | ||
| npx web-ext build --source-dir=. --artifacts-dir=. \ | ||
| --ignore-files="node_modules/*" "test/*" "demo/*" "*.svg" \ | ||
| "package*.json" "eslint.config.*" ".github/*" "AGENTS.md" \ | ||
| "CLAUDE.md" "CHANGELOG.md" "PRIVACY.md" "README.md" ".gitignore" \ | ||
| ".node-version" "docs/*" "Makefile" | ||
| mv github_pr_dashboard-*.zip github-pr-dashboard-firefox-unsigned.xpi | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: | | ||
| github-pr-dashboard-chrome.zip | ||
| github-pr-dashboard-firefox-unsigned.xpi | ||
| generate_release_notes: true | ||
| append_body: true | ||
| body: | | ||
| ## Install | ||
|
|
||
| | Browser | File | Notes | | ||
| |---------|------|-------| | ||
| | Chrome | `github-pr-dashboard-chrome.zip` | Unzip, then Load unpacked in `chrome://extensions` | | ||
| | Firefox | `github-pr-dashboard-firefox-unsigned.xpi` | **Unsigned** — works as a temporary add-on only (removed on browser close). For a persistent install, use the signed version from [addons.mozilla.org](https://addons.mozilla.org) when available. | |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||||
| .DEFAULT_GOAL := menu | ||||||||||
| .PHONY: menu install test lint ci build demo release help list | ||||||||||
| .PHONY: menu install test lint ci build demo release tag help list | ||||||||||
|
|
||||||||||
| # Colors | ||||||||||
| CYAN := \033[36m | ||||||||||
|
|
@@ -31,8 +31,9 @@ menu: | |||||||||
| @printf " $(YELLOW)5)$(RESET) make ci $(DIM)Run lint + test + build (CI pipeline)$(RESET)\n" | ||||||||||
| @printf "\n" | ||||||||||
| @printf " $(BOLD)$(GREEN)=== Release ===$(RESET)\n" | ||||||||||
| @printf " $(YELLOW)6)$(RESET) make release $(DIM)Bump version, tag, and push$(RESET)\n" | ||||||||||
| @printf " $(YELLOW)7)$(RESET) make demo $(DIM)Build demo extension for screenshots$(RESET)\n" | ||||||||||
| @printf " $(YELLOW)6)$(RESET) make release $(DIM)Bump version and create PR$(RESET)\n" | ||||||||||
| @printf " $(YELLOW)7)$(RESET) make tag $(DIM)Tag merged release and push$(RESET)\n" | ||||||||||
| @printf " $(YELLOW)8)$(RESET) make demo $(DIM)Build demo extension for screenshots$(RESET)\n" | ||||||||||
| @printf "\n" | ||||||||||
| @read -p " Enter choice: " choice; \ | ||||||||||
| case $$choice in \ | ||||||||||
|
|
@@ -42,7 +43,8 @@ menu: | |||||||||
| 4) $(MAKE) install ;; \ | ||||||||||
| 5) $(MAKE) ci ;; \ | ||||||||||
| 6) $(MAKE) release ;; \ | ||||||||||
| 7) $(MAKE) demo ;; \ | ||||||||||
| 7) $(MAKE) tag ;; \ | ||||||||||
| 8) $(MAKE) demo ;; \ | ||||||||||
| *) echo "Invalid choice" ;; \ | ||||||||||
| esac | ||||||||||
|
|
||||||||||
|
|
@@ -97,20 +99,28 @@ release: | |||||||||
| esac; \ | ||||||||||
| if [ -z "$$VERSION" ]; then echo "Aborted."; exit 1; fi; \ | ||||||||||
| printf "\n$(BOLD)Releasing $(CYAN)v$$VERSION$(RESET)\n\n"; \ | ||||||||||
| BRANCH="release/v$$VERSION"; \ | ||||||||||
| git checkout main; \ | ||||||||||
| git pull --ff-only origin main; \ | ||||||||||
| if [ -n "$$(git status --porcelain)" ]; then echo "Working tree not clean"; exit 1; fi; \ | ||||||||||
| git checkout -b "$$BRANCH"; \ | ||||||||||
| node -e "var p=require('./package.json');p.version='$$VERSION';require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"; \ | ||||||||||
| sed -i 's/"version": ".*"/"version": "'"$$VERSION"'"/' manifest.json; \ | ||||||||||
| $(MAKE) ci; \ | ||||||||||
| git add package.json manifest.json; \ | ||||||||||
| git commit -m "Release v$$VERSION"; \ | ||||||||||
| git tag "v$$VERSION"; \ | ||||||||||
| printf "\n$(BOLD)$(GREEN)Tagged v$$VERSION$(RESET)\n"; \ | ||||||||||
| read -p "Push to remote? [y/N] " PUSH; \ | ||||||||||
| if [ "$$PUSH" = "y" ] || [ "$$PUSH" = "Y" ]; then \ | ||||||||||
| git push && git push --tags; \ | ||||||||||
| printf "$(BOLD)$(GREEN)Pushed. GitHub Actions will create the release.$(RESET)\n"; \ | ||||||||||
| else \ | ||||||||||
| printf "Run $(CYAN)git push && git push --tags$(RESET) when ready.\n"; \ | ||||||||||
| fi | ||||||||||
| git push -u origin "$$BRANCH"; \ | ||||||||||
| gh pr create --title "Release v$$VERSION" --body "Bump version to $$VERSION" --base main; \ | ||||||||||
| printf "\n$(BOLD)$(GREEN)PR created for v$$VERSION$(RESET)\n"; \ | ||||||||||
| printf " After merging, run: $(CYAN)make tag VERSION=$$VERSION$(RESET)\n\n" | ||||||||||
|
|
||||||||||
| tag: | ||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||
| @if [ -z "$(VERSION)" ]; then echo "Usage: make tag VERSION=x.y.z"; exit 1; fi | ||||||||||
| @git checkout main | ||||||||||
| @git pull | ||||||||||
|
Comment on lines
+119
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's locate and read the Makefile around lines 119-120
fd -name "Makefile" -type f | head -5Repository: internetblacksmith/github-pr-dashboard Length of output: 312 🏁 Script executed: # Read the Makefile to see full context around lines 119-120
wc -l MakefileRepository: internetblacksmith/github-pr-dashboard Length of output: 94 🏁 Script executed: # Get context around lines 119-120
sed -n '100,135p' MakefileRepository: internetblacksmith/github-pr-dashboard Length of output: 1873 Use Line 120 uses plain Suggested fix `@git` checkout main
- `@git` pull
+ `@git` pull --ff-only origin main📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| @git tag "v$(VERSION)" | ||||||||||
| @git push origin "v$(VERSION)" | ||||||||||
| @printf "\n$(BOLD)$(GREEN)Tagged v$(VERSION) — GitHub Actions will create the release.$(RESET)\n" | ||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||
|
|
||||||||||
| help: | ||||||||||
| @printf "\n" | ||||||||||
|
|
@@ -121,7 +131,8 @@ help: | |||||||||
| @printf " $(CYAN)make build$(RESET) Create distributable zip\n" | ||||||||||
| @printf " $(CYAN)make install$(RESET) Install dev dependencies\n" | ||||||||||
| @printf " $(CYAN)make ci$(RESET) Run lint + test + build\n" | ||||||||||
| @printf " $(CYAN)make release$(RESET) Bump version, tag, and push\n" | ||||||||||
| @printf " $(CYAN)make release$(RESET) Bump version and create PR\n" | ||||||||||
| @printf " $(CYAN)make tag$(RESET) Tag merged release and push\n" | ||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||
| @printf " $(CYAN)make demo$(RESET) Build demo extension for screenshots\n" | ||||||||||
| @printf "\n" | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: internetblacksmith/github-pr-dashboard
Length of output: 92
🏁 Script executed:
cat -n ./Makefile | head -120Repository: internetblacksmith/github-pr-dashboard
Length of output: 5783
Add fail-fast to the
releaserecipe to prevent continuing after git errors.The recipe runs as a single shell command list with backslash continuations. Without
set -e, failures on lines 103 (git checkout), 104 (git pull), or 106 (git checkout -b) will not exit the script, allowing subsequent operations like package.json modifications to proceed on the wrong branch or state. Addset -euat the recipe start.Suggested fix
🤖 Prompt for AI Agents