-
Notifications
You must be signed in to change notification settings - Fork 25
118 lines (104 loc) · 4.4 KB
/
e2e.nodejs.release.main.default.slsa3.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
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
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
release:
types: [created]
permissions: read-all
concurrency: "e2e-nodejs-release-main-default-slsa3"
env:
GH_TOKEN: ${{ secrets.E2E_NODEJS_TOKEN }}
ISSUE_REPOSITORY: slsa-framework/slsa-github-generator
DEFAULT_VERSION: v40.0.0
jobs:
# Bootstrap
################################################################################
bootstrap:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Bumps the package version pushes, creates a git tag, and pushes the tag.
- run: ./.github/workflows/scripts/e2e-bootstrap.sh
if-bootstrap-failed:
runs-on: ubuntu-latest
needs: [bootstrap]
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && needs.bootstrap.result != 'success'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: ./.github/workflows/scripts/e2e-report-failure.sh
# Main workflow
################################################################################
# Shim determines if the rest of the workflow should run.
# NOTE: it should only use the `if` to determine this and all downstream jobs
# should depend on this job.
shim:
# NOTE: this must be kept in sync with the if-failed job.
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v40')
runs-on: ubuntu-latest
steps:
- run: |
echo "event: ${GITHUB_EVENT_NAME}"
echo "ref: ${GITHUB_REF}"
build:
needs: [shim]
permissions:
id-token: write # For signing.
contents: read # For repo checkout of private repos.
actions: read # For getting workflow run on private repos.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@main
with:
directory: e2e/nodejs/e2e-nodejs-release-main-default-slsa3
node-version: 16
run-scripts: "ci, build"
publish:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Set up Node environment
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: publish
id: publish
uses: slsa-framework/slsa-github-generator/actions/nodejs/publish@main
with:
access: public
node-auth-token: ${{ secrets.E2E_NODE_ACCESS_TOKEN }}
package-name: ${{ needs.build.outputs.package-name }}
package-download-name: ${{ needs.build.outputs.package-download-name }}
package-download-sha256: ${{ needs.build.outputs.package-download-sha256 }}
provenance-name: ${{ needs.build.outputs.provenance-name }}
provenance-download-name: ${{ needs.build.outputs.provenance-download-name }}
provenance-download-sha256: ${{ needs.build.outputs.provenance-download-sha256 }}
verify:
runs-on: ubuntu-latest
needs: [build, publish]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Node environment
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: 16
# NOTE: for building the verifier.
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: "1.21"
- run: ./.github/workflows/scripts/e2e.nodejs.default.verify.sh
if-succeeded:
runs-on: ubuntu-latest
needs: [build, publish, verify]
if: needs.build.result == 'success' && needs.publish.result == 'success' && needs.verify.result == 'success'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: ./.github/workflows/scripts/e2e-report-success.sh
if-failed:
runs-on: ubuntu-latest
needs: [shim, build, publish, verify]
if: always() && github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v40') && (needs.build.result != 'success' || needs.publish.result != 'success' || needs.verify.result != 'success')
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: ./.github/workflows/scripts/e2e-report-failure.sh