Skip to content

Commit

Permalink
ci: update pnpm action and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobLinCool committed Sep 11, 2023
1 parent c7db067 commit 63c0b5b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v2.4.0
with:
version: latest
run_install: true

- name: Build Docs
run: pnpm i && pnpm run docs
run: pnpm run docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
66 changes: 17 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,30 @@ jobs:
release-npm:
name: Release NPM (${{ github.ref }})
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check if Tag on Main
run: |
git checkout main
branch=$(git branch main --contains ${{ github.ref }})
git checkout ${{ github.ref }}
if [ -z $branch ]; then
echo "Tag ${{ github.ref }} is not contained in the main branch."
exit 1
fi

- name: Setup PNPM
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v2.4.0
with:
version: latest
run_install: true

- name: Build & Test
run: pnpm build && pnpm test

- name: Publish
run: |
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
pnpm publish --verbose --no-git-checks
release-note:
name: Release Note (${{ github.ref }})
runs-on: ubuntu-latest
needs:
- release-npm
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check if Tag on Main
run: |
git checkout main
branch=$(git branch main --contains ${{ github.ref }})
git checkout ${{ github.ref }}
if [ -z $branch ]; then
echo "Tag ${{ github.ref }} is not contained in the main branch."
exit 1
fi
- name: Build
run: pnpm build

- name: Publish Release
uses: "marvinpinto/action-automatic-releases@latest"
- name: Create Release Pull Request or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
repo_token: "${{ secrets.GH_TOKEN }}"
prerelease: false
files: |
README.md
LICENSE
publish: pnpm changeset publish
version: pnpm changeset version
title: Release Packages
commit: bump versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v2.4.0
with:
version: latest
run_install: true

- name: Build
run: pnpm i && pnpm build
run: pnpm build

- name: Test (w/ service)
run: sudo -E $PNPM_HOME/pnpm test
Expand Down

0 comments on commit 63c0b5b

Please sign in to comment.