-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (75 loc) · 2.79 KB
/
release-please.yml
File metadata and controls
81 lines (75 loc) · 2.79 KB
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
on:
push:
branches:
- main
permissions:
id-token: write
attestations: write
contents: write
pull-requests: write
issues: write
name: release
jobs:
release-please:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max-old-space-size=8192'
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
releases_created: ${{ steps.release.outputs.releases_created }}
compiler_release_created: ${{ steps.release.outputs['packages/typespec--release_created'] }}
runtime_release_created: ${{ steps.release.outputs['packages/runtime--release_created'] }}
prs_created: ${{ steps.release.outputs.prs_created }}
pr_number: ${{ steps.pr_number.outputs.pr_number }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ steps.release.outputs.prs_created}}
id: pr_number
env:
PR: ${{ steps.release.outputs.pr }}
TAG_NAME: ${{ steps.release.outputs.tag_name }}
RELEASES_CREATED: ${{ steps.release.outputs.releases_created }}
COMPILER_RELEASE_CREATED: ${{ steps.release.outputs['packages/typespec--release_created'] }}
RUNTIME_RELEASE_CREATED: ${{ steps.release.outputs['packages/runtime--release_created'] }}
PRS_CREATED: ${{ steps.release.outputs.prs_created }}
run: |
echo "tag_name=$TAG_NAME"
echo "released_created=$RELEASES_CREATED"
echo "compiler_release_created=$COMPILER_RELEASE_CREATED"
echo "runtime_release_created=$RUNTIME_RELEASE_CREATED"
echo "prs_created=$PRS_CREATED"
echo "pr_number=$(echo $PR | jq .number)" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs:
- release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
env:
NODE_OPTIONS: '--max-old-space-size=8192'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: moonrepo/setup-toolchain@v0
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: '22.22.0'
cache: 'pnpm'
- run: pnpm install
- uses: actions/cache@v5
with:
path: .moon/cache
key: ${{ runner.os }}-moon
- run: moon run typespec:publish
if: ${{ needs.release-please.outputs.compiler_release_created == 'true' }}
- run: moon run runtime:publish
if: ${{ needs.release-please.outputs.runtime_release_created == 'true' }}