-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (67 loc) · 2.3 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
75
76
77
78
name: Release
on:
push:
tags:
- "*"
branches:
- main
jobs:
release:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: false
prerelease: false
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Run Release Script
env:
GITHUB_DOWNLOAD_URL: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}
GITHUB_REF_NAME: ${{ github.ref_name }}
run: bun run release
- name: Zip Release Artifacts
run: bun run zip
- name: Generate artifact attestation for MCP server binaries
uses: actions/attest-build-provenance@v2
with:
subject-path: "packages/mcp-server/dist/*"
- name: Get existing release body
id: get_release_body
uses: actions/github-script@v7
with:
result-encoding: string # This tells the action to return a raw string
script: |
const release = await github.rest.repos.getRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ steps.create_release.outputs.id }}
});
return release.data.body || '';
- name: Upload Release Artifacts
env:
GH_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitName: true
tag: ${{ github.ref_name }}
artifacts: "packages/obsidian-plugin/releases/obsidian-plugin-*.zip,main.js,manifest.json,styles.css,packages/mcp-server/dist/*"
body: |
${{ steps.get_release_body.outputs.result }}
---
✨ This release includes attested build artifacts.
📝 View attestation details in the [workflow run](${{ env.GH_WORKFLOW_URL }})