-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add a workflow for releasing, candidate or GA #147
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Changesets | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
level: | ||
description: 'Release type' | ||
required: true | ||
default: 'preview' | ||
type: choice | ||
options: | ||
- preview | ||
- general availability | ||
env: | ||
CI: true | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
jobs: | ||
version: | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: setup node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
- name: install pnpm | ||
run: npm i pnpm@latest -g | ||
- name: Setup npmrc | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | ||
- name: setup pnpm config | ||
run: pnpm config set store-dir $PNPM_CACHE_FOLDER | ||
- name: install dependencies | ||
run: pnpm install | ||
- name: set pre-release | ||
if: ${{ inputs.level }} == 'preview' | ||
run: pnpm changeset pre enter rc | ||
- name: create and publish versions | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm ci:version | ||
commit: "chore: update versions" | ||
title: "chore: update versions" | ||
publish: pnpm ci:publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? If so, how is this token defined please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a secret provided by github which allows actions to do actions against the repository, such as creating pull requests or pushing code. https://docs.github.com/en/actions/security-guides/automatic-token-authentication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How/where is this secret defined please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a secret defined for the action, that can be at repository or organization level. https://docs.github.com/en/actions/security-guides/encrypted-secrets