Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 committed Apr 20, 2024
1 parent 1b2767b commit 05fe07b
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
push:
branches: [main]

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

jobs:
build:
release:
runs-on: ubuntu-latest

# This environment contains secrets needed for publishing
Expand All @@ -22,6 +25,26 @@ jobs:
# Don't save creds in the git config (so it's easier to override later)
persist-credentials: false

# This repo is inactive, so the tokens for publishing have been removed.
# To release, you must generate fine-grained npm and GitHub tokens (with write access for ONLY
# this repo and npm package/scope) and save them as secrets under Settings => Environments => release.
- name: Check tokens
uses: actions/github-script@v7
env:
NPM_AUTHTOKEN: ${{ secrets.NPM_AUTHTOKEN }}
REPO_PAT: ${{ secrets.REPO_PAT }}
with:
script: |
const fs = require('fs');
if (!process.env.NPM_AUTHTOKEN || !process.env.REPO_PAT) {
const releaseMessage = 'Secrets required for release are missing. See release.yml for instructions.';
if (fs.existsSync('change')) {
core.setFailed(releaseMessage);
} else {
core.warning(releaseMessage);
}
}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down

0 comments on commit 05fe07b

Please sign in to comment.