Skip to content

Commit 990bc59

Browse files
committed
add publish-packages
1 parent 0a20f49 commit 990bc59

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
on:
3+
# NOTE: avoid using the manual execution unless is the only way to fix some issue,
4+
# rather retry failed jobs in case of flakes. The manual execution can potentially
5+
# cause the tags to point to a different commit that the one used to publish
6+
# the packages
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
publish:
14+
if: |
15+
github.event_name == 'workflow_dispatch' ||
16+
startsWith(github.event.head_commit.message, 'chore(release): bump package versions')
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
# don't checkout a detatched HEAD
24+
ref: ${{ github.head_ref }}
25+
26+
# this is important so git log has the whole history
27+
fetch-depth: '0'
28+
29+
- name: Setup git
30+
run: |
31+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
32+
git config --local user.name "github-actions[bot]"
33+
34+
- name: "Use Node.js 14"
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 20.16.0
38+
39+
- name: Install [email protected]
40+
run: npm install -g [email protected]
41+
42+
- name: Install Dependencies
43+
run: |
44+
npm run bootstrap-ci
45+
shell: bash
46+
47+
- name: "Publish what is not already in NPM"
48+
env:
49+
NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }}
50+
run: |
51+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
52+
npm config list
53+
echo "Publishing packages as $(npm whoami)"
54+
git update-index --assume-unchanged .npmrc
55+
npm run publish-packages
56+
57+
- name: "Publish tags"
58+
run: |
59+
npx lerna list -a --json | \
60+
jq -r '.[] | .name + "@" + .version' | \
61+
xargs -i sh -c "git tag -a {} -m {} || true"
62+
git push --follow-tags

packages/build/src/release.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { publishAuxiliaryPackages } from './publish-auxiliary';
2727

2828
export type ReleaseCommand =
2929
| 'bump'
30-
| 'bump-packages'
3130
| 'compile'
3231
| 'package'
3332
| 'sign'

0 commit comments

Comments
 (0)