|
| 1 | +name: Build and Upload Assets |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + - 'version-*' |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: build-assets-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: write |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-assets: |
| 18 | + name: Build JS/CSS and upload to release |
| 19 | + runs-on: ubuntu-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + repository: frappe/frappe |
| 25 | + path: apps/frappe |
| 26 | + ref: ${{ github.ref_name }} |
| 27 | + |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + path: apps/hrms |
| 31 | + |
| 32 | + - name: Create bench structure |
| 33 | + run: | |
| 34 | + mkdir -p sites |
| 35 | + printf "frappe\nhrms\n" > sites/apps.txt |
| 36 | +
|
| 37 | + - uses: actions/setup-node@v4 |
| 38 | + with: |
| 39 | + node-version: 24 |
| 40 | + cache: yarn |
| 41 | + cache-dependency-path: apps/frappe/yarn.lock |
| 42 | + |
| 43 | + - name: Install frappe JS dependencies |
| 44 | + working-directory: apps/frappe |
| 45 | + run: yarn install --frozen-lockfile |
| 46 | + |
| 47 | + - name: Install hrms JS dependencies |
| 48 | + working-directory: apps/hrms |
| 49 | + run: yarn install --frozen-lockfile --ignore-scripts |
| 50 | + |
| 51 | + - name: Link node_modules into public/ |
| 52 | + working-directory: apps/frappe |
| 53 | + run: ln -s "$PWD/node_modules" frappe/public/node_modules |
| 54 | + |
| 55 | + - name: Build assets (production) |
| 56 | + working-directory: apps/frappe |
| 57 | + run: yarn run production |
| 58 | + |
| 59 | + - name: Package assets |
| 60 | + working-directory: apps/hrms |
| 61 | + run: tar czf hrms-assets.tar.gz -C ../../sites/assets/hrms dist |
| 62 | + |
| 63 | + - name: Upload to rolling release |
| 64 | + working-directory: apps/hrms |
| 65 | + env: |
| 66 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + run: | |
| 68 | + TAG="assets-${GITHUB_REF_NAME//\//-}" |
| 69 | + gh release create "$TAG" --prerelease --title "Assets: $GITHUB_REF_NAME" --notes "" 2>/dev/null || true |
| 70 | + gh release upload "$TAG" hrms-assets.tar.gz --clobber |
0 commit comments