Merge pull request #18 from JensorX/styles-fix #88
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: Build and Push Dist | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: '**/package-lock.json' | |
| - name: Build Mods | |
| run: | | |
| cd mods | |
| npm install | |
| npx rollup -c | |
| - name: Build Service | |
| run: | | |
| cd service | |
| npm install | |
| npx rollup -c | |
| - name: Bump Version | |
| run: | | |
| node -e "const fs = require('fs'); let pkg = JSON.parse(fs.readFileSync('package.json')); let v = pkg.version.split('.'); v[v.length-1] = parseInt(v[v.length-1]) + 1; pkg.version = v.join('.'); fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');" | |
| - name: Commit and Push changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add dist/ package.json | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "Auto-build: Update dist files and bump version [skip ci]" | |
| git push | |
| fi | |
| - name: Purge jsDelivr cache | |
| run: | | |
| curl -s https://purge.jsdelivr.net/gh/JensorX/TizenTube@main/dist/userScript.js | |
| curl -s https://purge.jsdelivr.net/gh/JensorX/TizenTube@main/dist/service.js | |
| curl -s https://purge.jsdelivr.net/gh/JensorX/TizenTube@main/package.json |