ci: package PBW release assetsUnverified
30f04fc parent: 30a8f4c modified
.github/workflows/deploy-bunny.yml +65 -2 | @@ -45,6 +45,62 @@ jobs: | ||
| 45 | 45 | |
| 46 | 46 | - run: npm test |
| 47 | 47 | |
| 48 | + package: | |
| 49 | + name: Build release PBW | |
| 50 | + needs: test | |
| 51 | + if: ${{ startsWith(github.ref_name, 'v') }} | |
| 52 | + runs-on: ubuntu-latest | |
| 53 | + environment: production | |
| 54 | + steps: | |
| 55 | + - uses: actions/checkout@v4 | |
| 56 | + | |
| 57 | + - uses: actions/setup-node@v4 | |
| 58 | + with: | |
| 59 | + node-version-file: .node-version | |
| 60 | + cache: npm | |
| 61 | + | |
| 62 | + - uses: oven-sh/setup-bun@v2 | |
| 63 | + with: | |
| 64 | + bun-version: 1.4.0 | |
| 65 | + | |
| 66 | + - uses: astral-sh/setup-uv@v6 | |
| 67 | + | |
| 68 | + - run: npm ci | |
| 69 | + | |
| 70 | + - name: Install pinned Pebble toolchain | |
| 71 | + run: | | |
| 72 | + uv tool install pebble-tool==5.0.40 | |
| 73 | + pebble sdk install 4.33.1 | |
| 74 | + | |
| 75 | + - name: Validate package version | |
| 76 | + env: | |
| 77 | + RELEASE_TAG: ${{ github.ref_name }} | |
| 78 | + run: | | |
| 79 | + PACKAGE_VERSION="$(node -p "require('./packages/watch/package.json').version")" | |
| 80 | + test "$RELEASE_TAG" = "v$PACKAGE_VERSION" | |
| 81 | + | |
| 82 | + - name: Build production PBW | |
| 83 | + env: | |
| 84 | + LAPIN_FUTE_CONFIG_URL: ${{ vars.CONFIG_SITE_ORIGIN }} | |
| 85 | + run: npm run build | |
| 86 | + | |
| 87 | + - name: Prepare release artifacts | |
| 88 | + env: | |
| 89 | + RELEASE_TAG: ${{ github.ref_name }} | |
| 90 | + run: | | |
| 91 | + mkdir release-assets | |
| 92 | + cp packages/watch/build/watch.pbw "release-assets/lapin-fute-$RELEASE_TAG.pbw" | |
| 93 | + ( | |
| 94 | + cd release-assets | |
| 95 | + sha256sum "lapin-fute-$RELEASE_TAG.pbw" > SHA256SUMS | |
| 96 | + ) | |
| 97 | + | |
| 98 | + - uses: actions/upload-artifact@v4 | |
| 99 | + with: | |
| 100 | + name: lapin-fute-${{ github.ref_name }} | |
| 101 | + path: release-assets/ | |
| 102 | + if-no-files-found: error | |
| 103 | + | |
| 48 | 104 | deploy: |
| 49 | 105 | name: Build and deploy configuration site |
| 50 | 106 | needs: test |
| @@ -246,7 +302,7 @@ jobs: | ||
| 246 | 302 | |
| 247 | 303 | publish: |
| 248 | 304 | name: Publish GitHub release notes |
| 249 | - needs: [test, deploy] | |
| 305 | + needs: [test, package, deploy] | |
| 250 | 306 | if: ${{ startsWith(github.ref_name, 'v') }} |
| 251 | 307 | runs-on: ubuntu-latest |
| 252 | 308 | permissions: |
| @@ -259,6 +315,12 @@ jobs: | ||
| 259 | 315 | fetch-depth: 0 |
| 260 | 316 | persist-credentials: false |
| 261 | 317 | |
| 318 | + - name: Download release artifacts | |
| 319 | + uses: actions/download-artifact@v4 | |
| 320 | + with: | |
| 321 | + name: lapin-fute-${{ github.ref_name }} | |
| 322 | + path: release-assets | |
| 323 | + | |
| 262 | 324 | - name: Generate categorized release notes |
| 263 | 325 | shell: bash |
| 264 | 326 | run: | |
| @@ -324,4 +386,5 @@ jobs: | ||
| 324 | 386 | --repo "$GITHUB_REPOSITORY" \ |
| 325 | 387 | --title "Lapin Futé $GITHUB_REF_NAME" \ |
| 326 | 388 | --notes-file release-notes.md \ |
| 327 | - --verify-tag | |
| 389 | + --verify-tag \ | |
| 390 | + release-assets/* | |
| @@ -45,6 +45,62 @@ jobs: | |||
| 45 | 45 | ||
| 46 | - run: npm test | 46 | - run: npm test |
| 47 | 47 | ||
| 48 | + package: | ||
| 49 | + name: Build release PBW | ||
| 50 | + needs: test | ||
| 51 | + if: ${{ startsWith(github.ref_name, 'v') }} | ||
| 52 | + runs-on: ubuntu-latest | ||
| 53 | + environment: production | ||
| 54 | + steps: | ||
| 55 | + - uses: actions/checkout@v4 | ||
| 56 | + | ||
| 57 | + - uses: actions/setup-node@v4 | ||
| 58 | + with: | ||
| 59 | + node-version-file: .node-version | ||
| 60 | + cache: npm | ||
| 61 | + | ||
| 62 | + - uses: oven-sh/setup-bun@v2 | ||
| 63 | + with: | ||
| 64 | + bun-version: 1.4.0 | ||
| 65 | + | ||
| 66 | + - uses: astral-sh/setup-uv@v6 | ||
| 67 | + | ||
| 68 | + - run: npm ci | ||
| 69 | + | ||
| 70 | + - name: Install pinned Pebble toolchain | ||
| 71 | + run: | | ||
| 72 | + uv tool install pebble-tool==5.0.40 | ||
| 73 | + pebble sdk install 4.33.1 | ||
| 74 | + | ||
| 75 | + - name: Validate package version | ||
| 76 | + env: | ||
| 77 | + RELEASE_TAG: ${{ github.ref_name }} | ||
| 78 | + run: | | ||
| 79 | + PACKAGE_VERSION="$(node -p "require('./packages/watch/package.json').version")" | ||
| 80 | + test "$RELEASE_TAG" = "v$PACKAGE_VERSION" | ||
| 81 | + | ||
| 82 | + - name: Build production PBW | ||
| 83 | + env: | ||
| 84 | + LAPIN_FUTE_CONFIG_URL: ${{ vars.CONFIG_SITE_ORIGIN }} | ||
| 85 | + run: npm run build | ||
| 86 | + | ||
| 87 | + - name: Prepare release artifacts | ||
| 88 | + env: | ||
| 89 | + RELEASE_TAG: ${{ github.ref_name }} | ||
| 90 | + run: | | ||
| 91 | + mkdir release-assets | ||
| 92 | + cp packages/watch/build/watch.pbw "release-assets/lapin-fute-$RELEASE_TAG.pbw" | ||
| 93 | + ( | ||
| 94 | + cd release-assets | ||
| 95 | + sha256sum "lapin-fute-$RELEASE_TAG.pbw" > SHA256SUMS | ||
| 96 | + ) | ||
| 97 | + | ||
| 98 | + - uses: actions/upload-artifact@v4 | ||
| 99 | + with: | ||
| 100 | + name: lapin-fute-${{ github.ref_name }} | ||
| 101 | + path: release-assets/ | ||
| 102 | + if-no-files-found: error | ||
| 103 | + | ||
| 48 | deploy: | 104 | deploy: |
| 49 | name: Build and deploy configuration site | 105 | name: Build and deploy configuration site |
| 50 | needs: test | 106 | needs: test |
| @@ -246,7 +302,7 @@ jobs: | |||
| 246 | 302 | ||
| 247 | publish: | 303 | publish: |
| 248 | name: Publish GitHub release notes | 304 | name: Publish GitHub release notes |
| 249 | - needs: [test, deploy] | 305 | + needs: [test, package, deploy] |
| 250 | if: ${{ startsWith(github.ref_name, 'v') }} | 306 | if: ${{ startsWith(github.ref_name, 'v') }} |
| 251 | runs-on: ubuntu-latest | 307 | runs-on: ubuntu-latest |
| 252 | permissions: | 308 | permissions: |
| @@ -259,6 +315,12 @@ jobs: | |||
| 259 | fetch-depth: 0 | 315 | fetch-depth: 0 |
| 260 | persist-credentials: false | 316 | persist-credentials: false |
| 261 | 317 | ||
| 318 | + - name: Download release artifacts | ||
| 319 | + uses: actions/download-artifact@v4 | ||
| 320 | + with: | ||
| 321 | + name: lapin-fute-${{ github.ref_name }} | ||
| 322 | + path: release-assets | ||
| 323 | + | ||
| 262 | - name: Generate categorized release notes | 324 | - name: Generate categorized release notes |
| 263 | shell: bash | 325 | shell: bash |
| 264 | run: | | 326 | run: | |
| @@ -324,4 +386,5 @@ jobs: | |||
| 324 | --repo "$GITHUB_REPOSITORY" \ | 386 | --repo "$GITHUB_REPOSITORY" \ |
| 325 | --title "Lapin Futé $GITHUB_REF_NAME" \ | 387 | --title "Lapin Futé $GITHUB_REF_NAME" \ |
| 326 | --notes-file release-notes.md \ | 388 | --notes-file release-notes.md \ |
| 327 | - --verify-tag | 389 | + --verify-tag \ |
| 390 | + release-assets/* | ||
modified
packages/config-page/test/config-site-build.test.ts +6 -2 | @@ -134,12 +134,16 @@ test("Bunny releases deploy production tags while preview tags stop after qualit | ||
| 134 | 134 | assert.doesNotMatch(workflow, /branches:\s*\[develop\]/u); |
| 135 | 135 | assert.match(workflow, /tags:\s*\["v\*", "pre-v\*"\]/u); |
| 136 | 136 | assert.match(workflow, /startsWith\(github\.ref_name, 'v'\)/u); |
| 137 | - assert.match(workflow, /publish:\s+name: Publish GitHub release notes[\s\S]+needs: \[test, deploy\]/u); | |
| 137 | + assert.match(workflow, /package:\s+name: Build release PBW[\s\S]+needs: test/u); | |
| 138 | + assert.match(workflow, /pebble-tool==5\.0\.40[\s\S]+pebble sdk install 4\.33\.1/u); | |
| 139 | + assert.match(workflow, /LAPIN_FUTE_CONFIG_URL: \$\{\{ vars\.CONFIG_SITE_ORIGIN \}\}[\s\S]+npm run build/u); | |
| 140 | + assert.match(workflow, /sha256sum "lapin-fute-\$RELEASE_TAG\.pbw" > SHA256SUMS/u); | |
| 141 | + assert.match(workflow, /publish:\s+name: Publish GitHub release notes[\s\S]+needs: \[test, package, deploy\]/u); | |
| 138 | 142 | assert.match(workflow, /\["log", "--first-parent", "-z", "--format=%s%x00%h"/u); |
| 139 | 143 | for (const title of ["Features", "Changes", "Fixes", "CI"]) { |
| 140 | 144 | assert.match(workflow, new RegExp(`title: "${title}"`, "u")); |
| 141 | 145 | } |
| 142 | - assert.match(workflow, /gh release create "\$GITHUB_REF_NAME"[\s\S]+--notes-file release-notes\.md[\s\S]+--verify-tag/u); | |
| 146 | + assert.match(workflow, /gh release create "\$GITHUB_REF_NAME"[\s\S]+--notes-file release-notes\.md[\s\S]+--verify-tag[\s\S]+release-assets\/\*/u); | |
| 143 | 147 | assert.doesNotMatch(workflow, /--generate-notes/u); |
| 144 | 148 | assert.match(workflow, /github\.event_name == 'workflow_dispatch' && inputs\.refresh_catalog/u); |
| 145 | 149 | assert.match(workflow, /refresh_catalog:\s+description:[\s\S]+type: boolean/u); |
| @@ -134,12 +134,16 @@ test("Bunny releases deploy production tags while preview tags stop after qualit | |||
| 134 | assert.doesNotMatch(workflow, /branches:\s*\[develop\]/u); | 134 | assert.doesNotMatch(workflow, /branches:\s*\[develop\]/u); |
| 135 | assert.match(workflow, /tags:\s*\["v\*", "pre-v\*"\]/u); | 135 | assert.match(workflow, /tags:\s*\["v\*", "pre-v\*"\]/u); |
| 136 | assert.match(workflow, /startsWith\(github\.ref_name, 'v'\)/u); | 136 | assert.match(workflow, /startsWith\(github\.ref_name, 'v'\)/u); |
| 137 | - assert.match(workflow, /publish:\s+name: Publish GitHub release notes[\s\S]+needs: \[test, deploy\]/u); | 137 | + assert.match(workflow, /package:\s+name: Build release PBW[\s\S]+needs: test/u); |
| 138 | + assert.match(workflow, /pebble-tool==5\.0\.40[\s\S]+pebble sdk install 4\.33\.1/u); | ||
| 139 | + assert.match(workflow, /LAPIN_FUTE_CONFIG_URL: \$\{\{ vars\.CONFIG_SITE_ORIGIN \}\}[\s\S]+npm run build/u); | ||
| 140 | + assert.match(workflow, /sha256sum "lapin-fute-\$RELEASE_TAG\.pbw" > SHA256SUMS/u); | ||
| 141 | + assert.match(workflow, /publish:\s+name: Publish GitHub release notes[\s\S]+needs: \[test, package, deploy\]/u); | ||
| 138 | assert.match(workflow, /\["log", "--first-parent", "-z", "--format=%s%x00%h"/u); | 142 | assert.match(workflow, /\["log", "--first-parent", "-z", "--format=%s%x00%h"/u); |
| 139 | for (const title of ["Features", "Changes", "Fixes", "CI"]) { | 143 | for (const title of ["Features", "Changes", "Fixes", "CI"]) { |
| 140 | assert.match(workflow, new RegExp(`title: "${title}"`, "u")); | 144 | assert.match(workflow, new RegExp(`title: "${title}"`, "u")); |
| 141 | } | 145 | } |
| 142 | - assert.match(workflow, /gh release create "\$GITHUB_REF_NAME"[\s\S]+--notes-file release-notes\.md[\s\S]+--verify-tag/u); | 146 | + assert.match(workflow, /gh release create "\$GITHUB_REF_NAME"[\s\S]+--notes-file release-notes\.md[\s\S]+--verify-tag[\s\S]+release-assets\/\*/u); |
| 143 | assert.doesNotMatch(workflow, /--generate-notes/u); | 147 | assert.doesNotMatch(workflow, /--generate-notes/u); |
| 144 | assert.match(workflow, /github\.event_name == 'workflow_dispatch' && inputs\.refresh_catalog/u); | 148 | assert.match(workflow, /github\.event_name == 'workflow_dispatch' && inputs\.refresh_catalog/u); |
| 145 | assert.match(workflow, /refresh_catalog:\s+description:[\s\S]+type: boolean/u); | 149 | assert.match(workflow, /refresh_catalog:\s+description:[\s\S]+type: boolean/u); |