forked from maxdavidson/rollup-plugin-sourcemaps
-
-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (69 loc) · 2.11 KB
/
release.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Test and release
# Run the workflow when a Pull Request is opened or when changes are pushed to master
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: macos-latest
strategy:
matrix:
# Run the steps below with the following versions of Node.js
node-version: [20.x, 22.x]
steps:
# Fetch the latest commit
- name: Checkout
uses: actions/checkout@v4
# Setup Node.js using the appropriate version
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
# Install package dependencies
- name: Install
run: npm ci
# Run build
- name: Build
run: yarn build
# Run tests
- name: Test
run: yarn test
# - name: Coveralls
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
release:
strategy:
matrix:
# Run the steps below with the following versions of Node.js
node-version: [22.x]
# Only release on push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: macos-latest
# Waits for test jobs for each Node.js version to complete
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
# Setup Node.js using the appropriate version
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22.x
# Install package dependencies
- name: Install
run: npm ci
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}