Refactor code structure for improved readability and maintainability #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release main-latest bundle | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-main-latest | |
| cancel-in-progress: true | |
| jobs: | |
| release-main-latest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Build minified bundle | |
| run: npm run build | |
| - name: Verify release asset exists | |
| run: | | |
| if [ ! -f dist/bind-manager.min.js ]; then | |
| echo "Missing dist/bind-manager.min.js after build" | |
| exit 1 | |
| fi | |
| - name: Ensure rolling release exists | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if ! gh release view main-latest >/dev/null 2>&1; then | |
| gh release create main-latest \ | |
| --title "Bind Manager main-latest" \ | |
| --notes "Rolling release for the latest commit on main." | |
| fi | |
| - name: Upload latest minified bundle | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload main-latest dist/bind-manager.min.js --clobber | |
| - name: Refresh release notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| RELEASE_NOTES="Rolling release for the latest commit on main. | |
| Source commit: $GITHUB_SHA | |
| Updated: $(date -u +'%Y-%m-%dT%H:%M:%SZ')" | |
| gh release edit main-latest \ | |
| --title "Bind Manager main-latest" \ | |
| --notes "$RELEASE_NOTES" |