Skip to content

Commit

Permalink
Publish with provenance via GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Feb 24, 2024
1 parent 51c7ee3 commit 7ddad21
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-rivers-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bitauth/libauth': patch
---

Publish with provenance via GitHub Actions
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
push:
branches:
- master
- next

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: yarn install --immutable --immutable-cache
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: yarn version
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<br />
<a href="https://www.npmjs.com/package/@bitauth/libauth"><img src="https://img.shields.io/npm/v/@bitauth/libauth.svg" alt="NPM version" /></a>
<a href="https://codecov.io/gh/bitauth/libauth"><img src="https://img.shields.io/codecov/c/github/bitauth/libauth/master.svg" alt="Codecov" /></a>
<a href="https://github.com/bitauth/libauth/actions/workflows/ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/bitauth/libauth/ci.yaml?branch=master" alt="CI" /></a>
<a href="https://github.com/bitauth/libauth/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/bitauth/libauth/ci.yml?branch=master" alt="CI" /></a>
<a href="https://twitter.com/libauth"><img alt="Follow Libauth on Twitter" src="https://img.shields.io/badge/follow-@libauth-1DA1F2?logo=twitter"></a>
<a href="https://t.me/libauth_dev"><img alt="Join Chat on Telegram" src="https://img.shields.io/badge/chat-Libauth%20Devs-0088CC?logo=telegram"></a>
<a href="https://www.npmjs.com/package/@bitauth/libauth"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@bitauth/libauth"></a>
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,15 @@
"cov": "yarn build && yarn test:unit && yarn cov:html && yarn cov:lcov && open-cli coverage/index.html",
"cov:html": "c8 report --reporter=html",
"cov:lcov": "c8 report --reporter=lcov",
"cov:check": "c8 report && c8 check-coverage --lines 80 --functions 80 --branches 80",
"doc": "yarn doc:html && yarn doc:html && open-cli build/docs/index.html",
"doc:logo": "cpy assets/libauth.svg build/docs",
"doc:html": "typedoc src/index.ts --out build/docs",
"doc:next": "yarn build && yarn doc:extract && yarn doc:generate",
"doc:extract": "mkdir -p build/api && api-extractor run --local --typescript-compiler-folder node_modules/typescript",
"doc:generate": "api-documenter markdown -i temp -o build/api/markdown",
"doc:check-api": "api-extractor run --typescript-compiler-folder node_modules/typescript",
"reset": "git clean -dfx && git reset --hard && yarn",
"prepare-release": "yarn reset && yarn test && yarn cov:check && yarn run version",
"prepare-release:alpha": "yarn reset && yarn test && yarn cov:check && yarn run version:alpha"
"version": "yarn changeset version && yarn fix:prettier",
"release": "yarn build && yarn changeset publish"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
Expand Down Expand Up @@ -140,6 +138,9 @@
"typedoc": "^0.25.7",
"typescript": "^5.3.3"
},
"publishConfig": {
"provenance": true
},
"files": [
"build",
"!build/.tsbuildinfo",
Expand Down

0 comments on commit 7ddad21

Please sign in to comment.