Skip to content

Commit

Permalink
ci: sets up automated publishing with provenance (#36)
Browse files Browse the repository at this point in the history
## Description

- sets up automated publishing with provenance

## Motivation and Context

I'm lazy

## How Has This Been Tested?
- [x] green ci

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation only change
- [ ] Refactor (non-breaking change which fixes an issue without
changing functionality)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist

- [x] 📖

  - My change doesn't require a documentation update, or ...
  - it _does_ and I have updated it

- [x] ⚖️
- The contribution will be subject to [The MIT license](../LICENSE), and
I'm OK with that.
  - The contribution is my own original work.
  - I am ok with the stuff in [**CONTRIBUTING.md**](./CONTRIBUTING.md).
  • Loading branch information
sverweij committed Oct 6, 2023
1 parent 8d13f79 commit 32a6e70
Show file tree
Hide file tree
Showing 4 changed files with 5,472 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/prerelease.yml
@@ -0,0 +1,21 @@
name: publish pre-releases as beta to npmjs
on:
release:
types: [prereleased]

jobs:
publish-as-beta:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: https://registry.npmjs.org
- run: npm clean-install
- run: npm publish --provenance --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,21 @@
name: publish to npmjs
on:
release:
types: [released]

jobs:
publish-as-latest:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: https://registry.npmjs.org
- run: npm clean-install
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .npmrc
@@ -1,3 +1,3 @@
package-lock = false
package-lock = true
save-exact = true
engine-strict = true

0 comments on commit 32a6e70

Please sign in to comment.