Skip to content

Commit

Permalink
Update GitHub workflows (includes package provenance #58)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Sep 26, 2024
1 parent 38aff64 commit 76c0c08
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/jsdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v1
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./out
49 changes: 25 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,42 @@ on:
jobs:
npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish --access=public
registry-url: https://registry.npmjs.org
- name: Install and build
run: |
npm ci
npm run build
- name: Publish to npm
run: npm publish --provenance --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm pack
- name: set release name, artifact, and message
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install, build, and pack
run: |
npm ci
npm run build
npm pack
- run: |
echo "ARTIFACT_NAME=$(ls cocoda-sdk-*.tgz)" >> $GITHUB_ENV
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
release_name: cocoda-sdk ${{ github.ref }}
name: cocoda-sdk ${{ github.ref_name }}
body: TODO
draft: true
prerelease: false
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.ARTIFACT_NAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/gzip
files: ${{ env.ARTIFACT_NAME }}
5 changes: 2 additions & 3 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ jobs:

strategy:
matrix:
node-version: [ 16.x, 18.x, 20.x ]
node-version: [ 18.x, 20.x, 22.x ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand Down

0 comments on commit 76c0c08

Please sign in to comment.