update deps, fix types (#78) #49
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
name: Version and publish packages with changesets | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
version: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Install dependencies with pnpm | |
uses: ./.github/actions/pnpm | |
- name: Build & test | |
uses: ./.github/actions/build-test | |
- name: Setup .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GH_TOKEN: ${{ secrets.GH_PAT }} | |
HOME: ${{ github.workspace }} | |
- name: Update Chrome extension version | |
run: | | |
export VERSION=$(cat ./packages/extension/package.json | grep version | awk -F'[ "]' 'NR==1{print $7}') && | |
sed -i 's/"version": "*.*.*"/"version": "'$VERSION'"/' ./packages/extension/public/manifest.json | |
sed -i 's/"version": "*.*.*"/"version": "'$VERSION'"/' ./packages/extension/dist/manifest.json | |
- name: Create and publish versions | |
uses: changesets/action@v1 | |
with: | |
version: pnpm ci:version | |
commit: 'chore(changeset): version update' | |
title: 'chore(changeset): version update' | |
publish: pnpm ci:publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HOME: ${{ github.workspace }} | |
- name: Archive Chrome Extension | |
uses: actions/upload-artifact@v3 | |
with: | |
name: chrome | |
path: ./packages/extension/dist |