|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ experimental, develop, main ] |
| 6 | + pull_request: |
| 7 | + branches: [ develop ] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + id-token: write |
| 12 | + |
| 13 | +env: |
| 14 | + NODE_VERSION: 22.12.0 |
| 15 | + RELEASE_BRANCH: main |
| 16 | + PREVIEW_BRANCH: develop |
| 17 | + CANARY_BRANCH: experimental |
| 18 | + NPM_CONFIG_PROVENANCE: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: Process Code |
| 23 | + runs-on: ubuntu-latest |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Use Node ${{ env.NODE_VERSION }} |
| 30 | + uses: actions/setup-node@v4 |
| 31 | + with: |
| 32 | + node-version: ${{ env.NODE_VERSION }} |
| 33 | + cache: yarn |
| 34 | + |
| 35 | + - name: Enable Corepack (Yarn) |
| 36 | + run: corepack enable |
| 37 | + |
| 38 | + - name: Install Dependencies |
| 39 | + run: yarn install |
| 40 | + |
| 41 | + - name: Build Code |
| 42 | + run: yarn build |
| 43 | + |
| 44 | + canary: |
| 45 | + name: Canary Packages |
| 46 | + needs: build |
| 47 | + runs-on: ubuntu-latest |
| 48 | + if: github.ref_name == 'experimental' |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout |
| 52 | + uses: actions/checkout@v4 |
| 53 | + with: |
| 54 | + fetch-depth: 0 |
| 55 | + |
| 56 | + - name: Use Node ${{ env.NODE_VERSION }} |
| 57 | + uses: actions/setup-node@v4 |
| 58 | + with: |
| 59 | + node-version: ${{ env.NODE_VERSION }} |
| 60 | + registry-url: https://registry.npmjs.org/ |
| 61 | + |
| 62 | + - name: Enable Corepack |
| 63 | + run: corepack enable |
| 64 | + |
| 65 | + - name: Install Dependencies |
| 66 | + run: yarn install |
| 67 | + |
| 68 | + - name: Build Code |
| 69 | + run: yarn build |
| 70 | + |
| 71 | + - name: Configure Git |
| 72 | + run: | |
| 73 | + git config --global user.email "releases@piral.io" |
| 74 | + git config --global user.name "Piral Release Bot" |
| 75 | +
|
| 76 | + - name: Set Build id |
| 77 | + run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV |
| 78 | + env: |
| 79 | + GITHUB_SHA: ${{ github.sha }} |
| 80 | + |
| 81 | + - name: Canary-Release Packages |
| 82 | + run: yarn ci:canary |
| 83 | + env: |
| 84 | + NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback |
| 85 | + NPM_CONFIG_PROVENANCE: true |
| 86 | + |
| 87 | + prerelease: |
| 88 | + name: Preview Packages |
| 89 | + needs: build |
| 90 | + runs-on: ubuntu-latest |
| 91 | + if: github.ref_name == 'develop' |
| 92 | + |
| 93 | + steps: |
| 94 | + - name: Checkout |
| 95 | + uses: actions/checkout@v4 |
| 96 | + with: |
| 97 | + fetch-depth: 0 |
| 98 | + |
| 99 | + - name: Use Node ${{ env.NODE_VERSION }} |
| 100 | + uses: actions/setup-node@v4 |
| 101 | + with: |
| 102 | + node-version: ${{ env.NODE_VERSION }} |
| 103 | + registry-url: https://registry.npmjs.org/ |
| 104 | + |
| 105 | + - name: Enable Corepack |
| 106 | + run: corepack enable |
| 107 | + |
| 108 | + - name: Install Dependencies |
| 109 | + run: yarn install |
| 110 | + |
| 111 | + - name: Build Code |
| 112 | + run: yarn build |
| 113 | + |
| 114 | + - name: Configure Git |
| 115 | + run: | |
| 116 | + git config --global user.email "releases@piral.io" |
| 117 | + git config --global user.name "Piral Release Bot" |
| 118 | +
|
| 119 | + - name: Set Build id |
| 120 | + run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV |
| 121 | + env: |
| 122 | + GITHUB_SHA: ${{ github.sha }} |
| 123 | + |
| 124 | + - name: Pre-Release Packages |
| 125 | + run: yarn ci:prerelease |
| 126 | + env: |
| 127 | + NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback |
| 128 | + NPM_CONFIG_PROVENANCE: true |
| 129 | + |
| 130 | + release: |
| 131 | + name: Release Packages |
| 132 | + needs: build |
| 133 | + runs-on: ubuntu-latest |
| 134 | + if: github.ref_name == 'main' |
| 135 | + |
| 136 | + steps: |
| 137 | + - name: Checkout |
| 138 | + uses: actions/checkout@v4 |
| 139 | + with: |
| 140 | + fetch-depth: 0 |
| 141 | + token: ${{ secrets.GH_PAT }} |
| 142 | + |
| 143 | + - name: Use Node ${{ env.NODE_VERSION }} |
| 144 | + uses: actions/setup-node@v4 |
| 145 | + with: |
| 146 | + node-version: ${{ env.NODE_VERSION }} |
| 147 | + registry-url: https://registry.npmjs.org/ |
| 148 | + |
| 149 | + - name: Enable Corepack |
| 150 | + run: corepack enable |
| 151 | + |
| 152 | + - name: Install Dependencies |
| 153 | + run: yarn install |
| 154 | + |
| 155 | + - name: Build Code |
| 156 | + run: yarn build |
| 157 | + |
| 158 | + - name: Configure Git |
| 159 | + run: | |
| 160 | + git config --global user.email "releases@piral.io" |
| 161 | + git config --global user.name "Piral Release Bot" |
| 162 | +
|
| 163 | + - name: Set Build id |
| 164 | + run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV |
| 165 | + env: |
| 166 | + GITHUB_SHA: ${{ github.sha }} |
| 167 | + |
| 168 | + - name: Update Release Date |
| 169 | + run: yarn ci:version-update |
| 170 | + |
| 171 | + - name: Release Packages |
| 172 | + run: yarn ci:release |
| 173 | + env: |
| 174 | + NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback |
| 175 | + NPM_CONFIG_PROVENANCE: true |
| 176 | + |
| 177 | + - name: Update Branches |
| 178 | + run: | |
| 179 | + git push origin ${RELEASE_BRANCH} --force |
| 180 | + git push --tags |
0 commit comments