This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
4a2fd30
commit 772a411
Showing
6 changed files
with
151 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) | ||
|
||
## Adding a changeset | ||
|
||
Use `npx changeset` to add a changeset. Pick the patch type that matches the changes you made (we use semantic versioning), and write a summary. This will be logged in a changeset file that you must commit to git. A recommended git message is of the form "docs(changeset): <summary>". | ||
|
||
The changeset file is just markdown (after the frontmatter) and will be used to generate a changelog when we release. | ||
|
||
Some changes do not (or should not) require a version bump. In order to log a changeset for such a change, use `npx changeset --blank` instead. |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "master", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Install dependencies | ||
author: Johannes L. Borresen | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Node.js | ||
|
||
uses: actions/[email protected] | ||
with: | ||
node-version: "19" | ||
|
||
# The steps that have been commented out are specific for caching the PNPM | ||
# store (central dependency cache) between builds. It has been kept in case | ||
# you want to use it. | ||
|
||
# - name: Setup pnpm | ||
# uses: pnpm/[email protected] | ||
# with: | ||
# run_install: false | ||
|
||
# - name: Detect PNPM store directory | ||
# shell: bash | ||
# run: | | ||
# echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
|
||
# - name: Setup cache | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: ${{ env.STORE_PATH }} | ||
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-pnpm-store- | ||
|
||
# Note: if caching is re-introduced, avoid use of `npm ci` as this command | ||
# removes node_modules before running. | ||
- name: Install dependencies | ||
shell: bash | ||
run: npm i |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This file's workflow invokes changesets to generate and publish a release. | ||
# If pushing to the master branch, the changesets action is used to maintain a | ||
# release-specific pull request, and trigger an actual release if that PR is | ||
# merged. | ||
# If pushing to develop, a snapshot release is published to the @develop tag | ||
# instead. | ||
|
||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
# Run unit tests by calling the workflow in unit_tests.yml | ||
unit_tests: | ||
name: Unit tests | ||
uses: ./.github/workflows/unit_tests.yml | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
# needs: unit_tests # Release step will ONLY run if unit tests complete. | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup (cache, dependencies) | ||
uses: ./.github/actions/install_and_cache_dependencies | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
# For stable branch, use changeset action to maintain a PR and finally | ||
# publish when appropriate. | ||
- name: Create release (or Pull Request) | ||
if: github.ref_name == 'master' | ||
uses: changesets/action@v1 | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
publish: npm run release | ||
|
||
# Snapshot releases don't need the changeset action to put together PRs. | ||
- name: Create snapshot release | ||
if: github.ref_name == 'develop' | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc | ||
npm run build | ||
npx changeset version --snapshot develop | ||
npx changeset publish --tag develop |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
name: Unit Tests | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
workflow_call: | ||
inputs: | ||
unused: | ||
type: boolean | ||
description: Unused, but it seems you must define *something* for workflow_call. | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup (cache, dependencies) | ||
uses: ./.github/actions/install_and_cache_dependencies | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Test | ||
run: npm test |
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