Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
validate:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
Comment thread
FlyOverCoderKY marked this conversation as resolved.
Resolved
env:
CI: "1"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -49,5 +51,8 @@ jobs:
- name: Check types
run: pnpm run check

- name: Check release metadata
run: pnpm run release:check

- name: Run tests
run: pnpm test
34 changes: 25 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
prepare:
runs-on: ubuntu-latest
env:
CI: "1"
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_PRERELEASE: ${{ github.event.release.prerelease }}
RELEASE_COMMIT: ${{ github.sha }}
Expand All @@ -29,6 +30,7 @@ jobs:
with:
ref: refs/tags/${{ github.event.release.tag_name }}
fetch-depth: 0
persist-credentials: false

- name: Fetch the protected release branch
run: git fetch --no-tags origin main:refs/remotes/origin/main
Expand All @@ -50,7 +52,7 @@ jobs:
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 24.18.0
registry-url: https://registry.npmjs.org
registry-url: https://registry.npmjs.org/
package-manager-cache: false

- name: Enable Corepack
Expand All @@ -66,15 +68,20 @@ jobs:
run: pnpm run format:check && pnpm run check && pnpm test

- name: Prepare and verify the release tarball
run: pnpm run release:pack -- --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}"
id: prepare-release
shell: bash
run: |
pnpm run release:pack -- --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}"
printf 'tarball=%s\n' ".release/pegma-webhooks-${RELEASE_TAG#v}.tgz" >> "${GITHUB_OUTPUT}"

- name: Upload the prepared release
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: webhooks-release-${{ github.run_id }}
path: .release/
path: |
.release/package-manifest.json
${{ steps.prepare-release.outputs.tarball }}
if-no-files-found: error
include-hidden-files: true
overwrite: true
retention-days: 30

Expand All @@ -90,24 +97,33 @@ jobs:
RELEASE_COMMIT: ${{ github.sha }}

steps:
- name: Check out the exact release tag
- name: Check out the release commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: refs/tags/${{ github.event.release.tag_name }}
ref: ${{ github.sha }}
fetch-depth: 1
persist-credentials: false

- name: Set up Node.js and npm
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 24.18.0
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Download the prepared release
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: webhooks-release-${{ github.run_id }}
path: .release
path: ${{ runner.temp }}/webhooks-release-${{ github.run_id }}

Comment thread
FlyOverCoderKY marked this conversation as resolved.
Resolved
- name: Create a clean Node invocation directory
id: node-invocation-directory
shell: bash
run: printf 'path=%s\n' "$(mktemp -d "${RUNNER_TEMP}/webhooks-publisher-XXXXXX")" >> "${GITHUB_OUTPUT}"

- name: Publish the verified prepared tarball
run: node scripts/release-package.mjs publish --expected-release-commit "${RELEASE_COMMIT}"
working-directory: ${{ steps.node-invocation-directory.outputs.path }}
run: >-
node "${GITHUB_WORKSPACE}/scripts/release-package.mjs" publish
--manifest "${RUNNER_TEMP}/webhooks-release-${GITHUB_RUN_ID}/package-manifest.json"
--expected-release-commit "${RELEASE_COMMIT}"
Loading
Loading