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
95 changes: 95 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: NPM release 🚀

on:
push:
tags:
- 'v*'

permissions:
contents: read

jobs:
build:
name: Build package 📦
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Update npm
run: npm install -g npm@latest # zizmor: ignore[adhoc-packages]
- name: Install npm deps
run: npm i
- name: Build package 🏗
run: |
mkdir pkg
npm pack --pack-destination pkg
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload build artifacts 📦
with:
name: pkg
retention-days: 7
path: ./pkg

create-github-release:
name: Create GitHub release 🐙
# Upload apackage to a GitHub release. It remains available as a build artifact for a while as well.
needs: build
runs-on: ubuntu-26.04
permissions:
contents: write
steps:
- name: Download build artifacts 📦
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ./pkg
- name: Create draft release 🐙
run: >-
gh release create
--verify-tag
--draft
--repo ${{ github.repository }}
--title ${GITHUB_REF_NAME}
${GITHUB_REF_NAME}
pkg/*
env:
GH_TOKEN: ${{ github.token }}

publish-npm:
name: Publish 🚀
needs: [build, create-github-release]
# Wait for approval before attempting to upload to NPM. This allows reviewing the files in the draft release.
environment: publish
runs-on: ubuntu-26.04
permissions:
contents: write
id-token: write
steps:
- name: Install Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Update npm
run: npm install -g npm@latest # zizmor: ignore[adhoc-packages]
- name: Download build artifacts 📦
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ./pkg
- name: Publish to NPM 🚀
run: npm publish ./pkg/*.tgz --tag latest --access public --provenance
- name: Publish GitHub release 🐙
run: >-
gh release edit
--draft=false
--repo ${{ github.repository }}
${GITHUB_REF_NAME}
env:
GH_TOKEN: ${{ github.token }}
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ on:
pull_request:
branches: [master]

permissions: {}

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@v5
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: lts/*

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Zizmor

on:
push:
paths: ['.github/**/*.yml']
branches:
- master
pull_request:
paths: ['.github/**/*.yml']

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
zizmor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
with:
advanced-security: false
annotations: true
Loading