FiloSottile / typage

A TypeScript implementation of the age file encryption format, based on libsodium.
BSD 3-Clause "New" or "Revised" License
105 stars 14 forks source link

Add CI auto-build #21

Closed paulmillr closed 4 months ago

paulmillr commented 4 months ago

Add CI auto-build:

Lock CI action commits:

Compared to 0.1.5, it's now 19x smaller:

FiloSottile commented 4 months ago

Thank you! No need to lock the versions in the test Actions, they have

permissions:
  contents: read

and I set the default to read-only, too.

image

About the esbuild release artifact, can you help me understand what/how downstream users use it? The README has an example for creating a file that sets a global variable. This instead would be an ES module, right? It's for use as a <script type="module">?

paulmillr commented 4 months ago

The end-result would look like one in here: https://github.com/paulmillr/noble-curves/releases/tag/1.4.2

It has global variable "age".

Which means it would be for plain classic <script src="..."></script>, not script type module. But it could probably be used with modules as well.

paulmillr commented 4 months ago

I also usually do NPM publish using CI: publish-npm.yml

It will build the package and upload it to NPM, using transparency logs. This would require adding NPM_PUBLISH_TOKEN to the repository.

It allows to keep one less token which can be stolen from my machine.

FiloSottile commented 4 months ago

Thank you! I went for something similar (I do this a lot) based on your PR. Main differences are using two build stages to drop privileges in the one that runs esbuild (and to always upload an artifact for debugging and to notice breakages even if it's not a release), and avoiding the separate package.json.

Opening an issue for NPM publishing, I would definitely like not to have this bearer token sitting around.