-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,55 +6,9 @@ on: | |
|
||
jobs: | ||
release-candidate: | ||
name: Candidate | ||
name: npm | ||
if: ${{ github.repository == 'primer/behaviors' }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Create .npmrc | ||
run: | | ||
cat << EOF > "$HOME/.npmrc" | ||
//registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
EOF | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }} | ||
|
||
- name: Publish release candidate | ||
run: | | ||
version=$(jq -r .version package.json) | ||
echo "$( jq ".version = \"$(echo $version)-rc.$(git rev-parse --short HEAD)\"" package.json )" > package.json | ||
yarn publish --tag next | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Output release candidate version number | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`) | ||
github.repos.createCommitStatus({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
sha: context.sha, | ||
state: 'success', | ||
context: `Published ${package.name}`, | ||
description: package.version, | ||
target_url: `https://unpkg.com/${package.name}@${package.version}/` | ||
}) | ||
uses: primer/.github/.github/workflows/release_candidate.yml@main | ||
secrets: | ||
gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
npm_token: ${{ secrets.NPM_AUTH_TOKEN_SHARED }} |