-
Notifications
You must be signed in to change notification settings - Fork 53
52 lines (50 loc) · 1.57 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
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
timeout-minutes: 30
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
if: github.repository_owner == 'evanderkoogh'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: 'Install NPM Dependencies'
run: 'pnpm install --frozen-lockfile --child-concurrency=10'
- name: Check the build
run: pnpm build
- name: 'Check for Errors'
run: 'pnpm check'
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update NPM Tags
# Changesets does not publish RC as latest. This will
# tag RC to latest until we get to a stable release.
if: steps.changesets.outputs.published == 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
set -eux
PUBLISHED_VERSION=$(echo '${{ steps.changesets.outputs.publishedPackages }}' \
| jq -er '[.[] | select(.name=="@microlabs/otel-cf-workers")][0].version')
npm dist-tag add @microlabs/otel-cf-workers@${PUBLISHED_VERSION} latest