|
| 1 | +# This workflow: |
| 2 | +# 1. builds the UI as build/ui-bundle.zip file |
| 3 | +# 2. creates a new patch release |
| 4 | +# 3. triggers production build |
| 5 | + |
| 6 | +name: Release |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + skip_publish: |
| 12 | + description: 'Should skip publishing to Netlify' |
| 13 | + required: false |
| 14 | + default: false |
| 15 | + type: boolean |
| 16 | + release_type: |
| 17 | + description: 'Type of the release' |
| 18 | + required: false |
| 19 | + default: 'patch' |
| 20 | + type: choice |
| 21 | + options: |
| 22 | + - major |
| 23 | + - minor |
| 24 | + - patch |
| 25 | + - prerelease |
| 26 | + - premajor |
| 27 | + push: |
| 28 | + branches: [ master ] |
| 29 | + |
| 30 | +jobs: |
| 31 | + build: |
| 32 | + name: Build |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + - uses: actions/setup-node@v4 |
| 37 | + with: |
| 38 | + node-version: 22 |
| 39 | + cache: 'npm' |
| 40 | + - name: Install NPM dependencies |
| 41 | + run: npm ci |
| 42 | + - name: Bundle UI |
| 43 | + run: npm run bundle |
| 44 | + - name: Upload static site |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: ui-bundle |
| 48 | + path: build/ui-bundle.zip |
| 49 | + release: |
| 50 | + name: Release |
| 51 | + runs-on: ubuntu-latest |
| 52 | + needs: build |
| 53 | + steps: |
| 54 | + - name: Download bundle |
| 55 | + uses: actions/download-artifact@v4 |
| 56 | + with: |
| 57 | + name: ui-bundle |
| 58 | + - name: Create release |
| 59 | + id: create_release |
| 60 | + uses: zendesk/action-create-release@v1 |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + with: |
| 64 | + auto_increment_type: ${{ github.event.inputs.release_type || 'patch' }} |
| 65 | + prerelease_suffix: beta |
| 66 | + tag_schema: semantic |
| 67 | + - name: Upload release asset |
| 68 | + uses: actions/upload-release-asset@v1 |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + with: |
| 72 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 73 | + asset_path: ui-bundle.zip |
| 74 | + asset_name: ui-bundle.zip |
| 75 | + asset_content_type: application/zip |
| 76 | + publish: |
| 77 | + if: github.event.inputs.skip_publish != true |
| 78 | + runs-on: ubuntu-latest |
| 79 | + needs: release |
| 80 | + steps: |
| 81 | + - name: Trigger build |
| 82 | + run: curl -X POST -d {} https://api.netlify.com/build_hooks/673db01c3496b5513b30c92e |
0 commit comments