Skip to content

Update dependencies and CI #129

Update dependencies and CI

Update dependencies and CI #129

Workflow file for this run

name: Build and upload bundle
on:
release:
types: [published]
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 25.x # Current as of 2025-12
- run: npm clean-install
- run: npm run build
- run: npm run lint
- run: npm run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 25.x # Current as of 2025-12
- run: npm clean-install
- run: npm run build
- run: node_modules/.bin/esbuild --target=es2022 --bundle --outfile=typage.js --global-name=age age-encryption
- run: node_modules/.bin/esbuild --target=es2022 --bundle --minify --outfile=typage.min.js --global-name=age age-encryption
- uses: actions/upload-artifact@v4
with:
name: age-esbuild
path: |
typage.js
typage.min.js
upload:
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
needs: [build, test]
permissions:
contents: write
id-token: write
attestations: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: age-esbuild
- run: |
mv typage.js "age-${VERSION#v}.js"
mv typage.min.js "age-${VERSION#v}.min.js"
gh release upload -R FiloSottile/typage "$VERSION" "age-*.js"
env:
VERSION: ${{ github.event.release.tag_name }}
GH_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: "age-*.js"
publish:
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
needs: upload
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 25.x # Current as of 2025-12
registry-url: "https://registry.npmjs.org"
- run: npm clean-install
- run: npx jsr publish
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}