v0.3.0 #147
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 25.x # Current as of 2025-12 | |
| package-manager-cache: false | |
| - uses: geomys/[email protected] | |
| with: | |
| run: | | |
| npm clean-install --ignore-scripts | |
| npm run build | |
| npm run lint | |
| npm run test:short | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 25.x # Current as of 2025-12 | |
| package-manager-cache: false | |
| - run: npm clean-install --ignore-scripts | |
| - run: npm run build | |
| - run: node_modules/.bin/esbuild --target=es2023 --bundle --outfile=typage.js --global-name=age age-encryption | |
| - run: node_modules/.bin/esbuild --target=es2023 --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' | |
| 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@v3 | |
| with: | |
| subject-path: "age-*.js" | |
| publish-npm: | |
| if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' | |
| needs: [build, test] | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 25.x # Current as of 2025-12 | |
| registry-url: "https://registry.npmjs.org" | |
| package-manager-cache: false | |
| - run: npm clean-install --ignore-scripts | |
| - run: npm publish --access public | |
| publish-jsr: | |
| if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' | |
| needs: [build, test] | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 25.x # Current as of 2025-12 | |
| package-manager-cache: false | |
| - run: npm clean-install --ignore-scripts | |
| - run: npx jsr publish |