-
-
Notifications
You must be signed in to change notification settings - Fork 777
102 lines (95 loc) · 2.54 KB
/
release.yml
File metadata and controls
102 lines (95 loc) · 2.54 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
name: Release Full
on:
workflow_dispatch:
inputs:
# NPM-specific inputs
npm_tag:
type: choice
description: 'Release Npm Tag'
required: true
options:
- canary
- nightly
- latest
- beta
- alpha
- rc
npm_tag_confirm:
type: choice
description: 'Release Npm Tag Double Check'
required: true
options:
- canary
- nightly
- latest
- beta
- alpha
- rc
test:
type: boolean
description: 'Run JS tests before release'
required: true
default: true
# Common inputs
dry_run:
type: boolean
description: 'DryRun release'
required: true
default: false
push_tags:
type: boolean
description: 'Push tags to repository'
required: true
default: true
# Control which releases to run
release_npm:
type: boolean
description: 'Release NPM packages'
required: false
default: true
release_crates:
type: boolean
description: 'Release Rust crates'
required: false
default: true
permissions:
# To publish packages with provenance
id-token: write
# Allow commenting on issues
issues: write
# Allow writing contents for tags
contents: write
jobs:
validate_inputs:
name: Validate Inputs
runs-on: ubuntu-latest
if: ${{ inputs.release_npm }}
steps:
- name: Validate npm tag confirmation
run: |
if [ "${{ inputs.npm_tag }}" != "${{ inputs.npm_tag_confirm }}" ]; then
echo "Error: npm_tag and npm_tag_confirm must match"
echo "npm_tag: ${{ inputs.npm_tag }}"
echo "npm_tag_confirm: ${{ inputs.npm_tag_confirm }}"
exit 1
fi
echo "npm_tag validation passed: ${{ inputs.npm_tag }}"
release_npm:
name: Release NPM Packages
if: ${{ inputs.release_npm }}
needs: [validate_inputs]
uses: ./.github/workflows/reusable-release-npm.yml
with:
tag: ${{ inputs.npm_tag }}
tag_confirm: ${{ inputs.npm_tag_confirm }}
test: ${{ inputs.test }}
dry_run: ${{ inputs.dry_run }}
push_tags: ${{ inputs.push_tags }}
release_crates:
name: Release Rust Crates
if: ${{ inputs.release_crates }}
uses: ./.github/workflows/reusable-release-crates.yml
with:
dry_run: ${{ inputs.dry_run }}
push_tags: ${{ inputs.push_tags }}
secrets: inherit