Repository navigation
131 lines (122 loc) · 3.8 KB
/
Copy pathrelease.yml
File metadata and controls
131 lines (122 loc) · 3.8 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
name: '[Manual|PR] Release'
on:
workflow_dispatch:
inputs:
debug:
description: 'Debug'
type: boolean
default: true
dry-run:
description: 'Dry run'
type: boolean
default: true
pull_request:
branches:
- main
- beta
- develop
- next-version
paths:
- '__mocks__/**'
- '__tests__/**'
- 'src/**'
- 'package*'
- 'ts*'
# a change to the release configuration must be able to run the release
- '.releaserc*'
# a change to a workflow must be able to run the workflow it changes
- '.github/workflows/**'
- '!www/**'
push:
branches:
- main
- beta
- develop
- next-version
paths:
- '__mocks__/**'
- '__tests__/**'
- 'src/**'
- 'package*'
- 'ts*'
# a change to the release configuration must be able to run the release
- '.releaserc*'
# a change to a workflow must be able to run the workflow it changes
- '.github/workflows/**'
- '!www/**'
# Default every read-only job to the minimum token scope. Release jobs override
# this with the additional write permissions they need below.
permissions:
contents: read
# Cancel redundant in-progress runs for the same ref (replaces the
# `cancel_others` behaviour of the now-unmaintained skip-duplicate-actions).
# Scoped to pull_request only: a push to a release branch is never cancelled,
# so an in-flight publish can never be interrupted by a newer push.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
tests-dev:
name: Run test on rpc-devnet
if: |
github.event_name != 'workflow_dispatch'
&& contains(fromJSON('["beta","develop","next-version"]'), github.base_ref || github.ref_name)
uses: ./.github/workflows/_test.yml
with:
use-devnet: true
tests-main:
name: Run test on ${{ matrix.node }} ${{ matrix.version }}
if: |
github.event_name != 'workflow_dispatch'
&& (github.base_ref || github.ref_name) == 'main'
strategy:
max-parallel: 1
fail-fast: false
# No protocol axis: each job now exercises every transport its urls allow, so splitting
# RPC from WS would only run the same suites twice across two jobs.
matrix:
node: [Juno, Pathfinder]
version: [v0_9, v0_10]
uses: ./.github/workflows/_test.yml
with:
node: ${{ matrix.node }}
version: ${{ matrix.version }}
secrets: inherit
# Builds, packs and installs the package as a user would: a broken entry point blocks the release.
package-check:
name: Check the built package
if: github.event_name != 'workflow_dispatch'
uses: ./.github/workflows/_package.yml
release-auto:
name: Release
needs: [tests-dev, tests-main, package-check]
# `always() && !failure()` lets the release proceed even when a test job is
# skipped (e.g. tests-main is skipped on non-`main` branches), while still
# blocking it if a test job actually fails. semantic-release is idempotent
# (no version bump = no publish), so running it on a duplicate push is safe.
if: |
always()
&& !failure()
&& github.event_name == 'push'
uses: ./.github/workflows/_release.yml
secrets: inherit
permissions:
packages: write
pull-requests: write
contents: write
issues: write
id-token: write
release-manual:
name: Release (manual)
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/_release.yml
with:
debug: ${{ inputs.debug }}
dry-run: ${{ inputs.dry-run }}
secrets: inherit
permissions:
packages: write
pull-requests: write
contents: write
issues: write
id-token: write