-
Notifications
You must be signed in to change notification settings - Fork 24
74 lines (62 loc) · 2.33 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
name: Release
on:
workflow_dispatch:
inputs:
post-publish-only:
type: boolean
description: "Run post-publish script without publishing"
default: false
# copy-pasted from ci.yml
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: quantified-uncertainty
# used by turbo cache hashes, see turbo.json
PLATFORM: github
# not needed while we don't run this workflow automatically
# concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build changelog script
working-directory: internal-packages/ops
run: pnpm turbo build
# if there are existing changesets, PR will be created.
# Otherwise, `publish` command will be invoked.
- name: Create Release Pull Request or Publish to npm
id: changesets
if: inputs.post-publish-only != true
uses: changesets/action@v1
with:
title: New release
version: pnpm run changeset-version
publish: pnpm run publish-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Extract published version
id: published-version
run: |
VERSION=$(cat packages/squiggle-lang/package.json | fgrep '"version"' | head -1 | perl -ne '/"version": "([^"]+)"/ && print $1')
echo "published-version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Prepare for next release
if: steps.changesets.outputs.published == 'true' || inputs.post-publish-only
run: pnpm run post-publish
- name: Create PR with version patches
if: steps.changesets.outputs.published == 'true' || inputs.post-publish-only
uses: peter-evans/create-pull-request@v7
with:
commit-message: Bump versions after ${{ steps.published-version.outputs.published-version }} release
title: Bump versions after ${{ steps.published-version.outputs.published-version }} release