-
Notifications
You must be signed in to change notification settings - Fork 6
65 lines (56 loc) · 1.92 KB
/
version-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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