-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
c651e89
commit 12dc77c
Showing
1 changed file
with
49 additions
and
25 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 |
---|---|---|
@@ -1,43 +1,67 @@ | ||
name: Release | ||
name: Test, Build, and Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
fetch-depth: 0 | ||
node-version: '18' | ||
|
||
- name: Install pnpm | ||
run: | | ||
corepack enable | ||
corepack prepare pnpm@latest --activate | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Run tests | ||
run: pnpm test | ||
|
||
- name: Build project | ||
run: pnpm run prepublish | ||
|
||
release: | ||
needs: build-and-test | ||
runs-on: ubuntu-latest | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
node-version: '18' | ||
|
||
- name: Install pnpm | ||
run: | | ||
corepack enable | ||
corepack prepare pnpm@latest --activate | ||
- name: Install Dependencies | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@v1 | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
publish: pnpm publish-packages | ||
files: | | ||
react-dynamic-fonts/dist/** | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Create GitHub Release | ||
uses: actions/create-release@v1 | ||
if: steps.changesets.outputs.published == 'true' | ||
- name: Publish to npm | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.changesets.outputs.publishedPackages[0].version }} | ||
release_name: Release ${{ steps.changesets.outputs.publishedPackages[0].version }} | ||
body: ${{ steps.changesets.outputs.publishedPackages[0].notes }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: pnpm publish --access public |