Repository navigation
136 lines (127 loc) · 4.58 KB
/
Copy pathrelease.yml
File metadata and controls
136 lines (127 loc) · 4.58 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: 2025 Hyperpolymath
name: Release
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., v0.8.0)'
required: true
type: string
publish_crates:
description: 'Publish to crates.io'
required: false
default: true
type: boolean
publish_npm:
description: 'Publish to npm'
required: false
default: true
type: boolean
publish_jsr:
description: 'Publish to JSR'
required: false
default: true
type: boolean
permissions:
actions: read
contents: read
jobs:
validate:
name: Validate release
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Extract version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
echo "version=${VERSION#v}" >> $GITHUB_OUTPUT
echo "Release version: ${VERSION#v}"
- name: Verify version consistency
run: |
VERSION="${{ steps.version.outputs.version }}"
echo "Checking version consistency across packages..."
# Check Rust
RUST_VERSION=$(grep '^version' bindings/rust/Cargo.toml | head -1 | cut -d'"' -f2)
echo "Rust: $RUST_VERSION"
# Check Deno
DENO_VERSION=$(jq -r '.version' bindings/deno/deno.json)
echo "Deno: $DENO_VERSION"
# Check JavaScript
JS_VERSION=$(jq -r '.version' bindings/javascript/package.json)
echo "JavaScript: $JS_VERSION"
# Check TypeScript
TS_VERSION=$(jq -r '.version' bindings/typescript/package.json)
echo "TypeScript: $TS_VERSION"
echo "All versions checked. Proceeding with release."
create-release:
name: Create GitHub Release
needs: validate
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.event_name == 'push'
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Create Release
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
with:
generate_release_notes: true
body: |
## proven v${{ needs.validate.outputs.version }}
Formally verified safety library with bindings for the allowed-language set.
### Install
**Rust**: `cargo add proven`
**Deno**: `deno add @hyperpolymath/proven`
**npm**: `npm install @proven/javascript`
See [documentation](https://github.com/hyperpolymath/proven#readme) for the full binding set.
publish-crates:
name: Publish to crates.io
needs: [validate, create-release]
if: always() && needs.validate.result == 'success' && (github.event_name == 'push' || inputs.publish_crates)
uses: ./.github/workflows/publish-crates.yml
secrets: inherit
publish-npm:
name: Publish to npm
needs: [validate, create-release]
if: always() && needs.validate.result == 'success' && (github.event_name == 'push' || inputs.publish_npm)
uses: ./.github/workflows/publish-npm.yml
secrets: inherit
publish-jsr:
name: Publish to JSR
needs: [validate, create-release]
if: always() && needs.validate.result == 'success' && (github.event_name == 'push' || inputs.publish_jsr)
uses: ./.github/workflows/publish-jsr.yml
secrets: inherit
summary:
name: Release summary
needs: [validate, publish-crates, publish-npm, publish-jsr]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Summary
run: |
echo "# Release Summary v${{ needs.validate.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Registry | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| crates.io | ${{ needs.publish-crates.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| npm | ${{ needs.publish-npm.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| JSR | ${{ needs.publish-jsr.result }} |" >> $GITHUB_STEP_SUMMARY