mirror of
https://github.com/primer/css.git
synced 2024-12-28 00:24:36 +03:00
d7804b2f5e
Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Katie Langerman <langermank@github.com>
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'changeset-release/**'
|
|
|
|
jobs:
|
|
release-candidate:
|
|
name: Candidate
|
|
if: ${{ github.repository == 'primer/css' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
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: 14.x
|
|
|
|
- name: Install dependencies
|
|
run: yarn
|
|
|
|
- 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 candidate version number
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`)
|
|
github.rest.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}/`
|
|
})
|