-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (58 loc) · 1.73 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
name: Release
on:
push:
branches:
- main
- '[0-9]+.x'
- '[0-9]+.[0-9]+.x'
concurrency: release
env:
FORCE_COLOR: 3
permissions:
contents: read
jobs:
release:
name: Release
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.triggering_actor != 'dependabot[bot]'
steps:
- name: Checkout
uses: Brightspace/third-party-actions@actions/checkout
with:
persist-credentials: false
- name: Set up node
uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: npm
- name: Release
id: release
uses: BrightspaceUI/actions/semantic-release@main
with:
GITHUB_TOKEN: ${{secrets.D2L_RELEASE_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NPM: true
- name: Trigger downstream updates
uses: Brightspace/third-party-actions@actions/github-script
if: github.ref == 'refs/heads/main' && steps.release.outputs.VERSION != ''
with:
github-token: ${{secrets.REPOSITORY_DISPATCH_TOKEN}}
script: |
const targets = [
'test-reporting-action',
'test-actions'
];
const results = await Promise.allSettled(targets.map(target =>
github.rest.repos.createDispatchEvent({
owner: 'Brightspace',
repo: target,
event_type: 'test-reporting-node-release',
})
));
console.log(results);
if (results.some(r => r.status === 'rejected')) {
throw new Error('Not all dispatches succeeded. See details above.');
}