-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.6 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (68 loc) · 2.6 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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
name: Version, changelog, and publish
runs-on: ubuntu-latest
steps:
- name: Create or finalize release
id: release
uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
- name: Check out repository
if: ${{ steps.release.outputs.release_created == 'true' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node.js
if: ${{ steps.release.outputs.release_created == 'true' }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Install dependencies
if: ${{ steps.release.outputs.release_created == 'true' }}
run: npm ci
- name: Test package
if: ${{ steps.release.outputs.release_created == 'true' }}
run: npm test
- name: Generate OpenCode release diff summary
if: ${{ steps.release.outputs.release_created == 'true' }}
continue-on-error: true
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
OPENCODE_MODEL: ${{ vars.OPENCODE_MODEL }}
RELEASE_TAG_NAME: ${{ steps.release.outputs.tag_name }}
run: node scripts/summarize-release-diff.mjs
- name: Append OpenCode summary to GitHub release
if: ${{ steps.release.outputs.release_created == 'true' }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG_NAME: ${{ steps.release.outputs.tag_name }}
run: |
if [ ! -s opencode-release-summary.md ]; then
echo "No OpenCode release summary was generated."
exit 0
fi
gh release view "$RELEASE_TAG_NAME" --json body --jq '.body // ""' > release-notes.md
{
cat release-notes.md
printf '\n\n## OpenCode Diff Summary\n\n'
cat opencode-release-summary.md
} > release-notes-with-opencode.md
gh release edit "$RELEASE_TAG_NAME" --notes-file release-notes-with-opencode.md
- name: Publish to npm
if: ${{ steps.release.outputs.release_created == 'true' }}
run: npm publish --access public