1
1
mirror of https://github.com/primer/css.git synced 2024-10-04 04:17:21 +03:00
css/.github/workflows/release_canary.yml

53 lines
1.6 KiB
YAML
Raw Normal View History

2021-03-26 23:26:40 +03:00
name: Release
on:
pull_request:
branches-ignore:
- 'main'
- 'changeset-release/main'
jobs:
release-canary:
if: ${{ github.repository == 'primer/css' }}
name: Canary
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
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@master
with:
node-version: 12.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 canary version
run: |
echo "$( jq '.version = "0.0.0"' package.json )" > package.json
echo -e "---\n'@primer/css': patch\n---\n\nFake entry to force publishing" > .changeset/force-snapshot-release.md
yarn changeset version --snapshot
yarn changeset publish --tag canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Output canary version number
run: |
name=$(jq -r .name package.json)
version=$(jq -r .version package.json)
npx action-status --context="Published $name" --state=success --description=$version --url "https://unpkg.com/$name@$version/"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}