Repository navigation
59 lines (56 loc) · 2.14 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (56 loc) · 2.14 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
name: Release
on:
push:
tags: ["v*"]
permissions: {}
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
id-token: write
attestations: write
env:
# The build otherwise reports usage to telemetry.astro.build.
ASTRO_TELEMETRY_DISABLED: 1
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: stats
path: stats-data
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"
- name: Build the source tarball
run: git archive --format=tar.gz --prefix="devstream-$GITHUB_REF_NAME/" -o "devstream-$GITHUB_REF_NAME.tar.gz" "$GITHUB_SHA"
- run: npm ci --ignore-scripts
working-directory: site
- run: npm test
working-directory: site
- run: npm run build
working-directory: site
- name: Package the site
run: tar -czf "devstream-site-$GITHUB_REF_NAME.tar.gz" -C site/dist .
- id: attest
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: |
devstream-${{ github.ref_name }}.tar.gz
devstream-site-${{ github.ref_name }}.tar.gz
# Attached so anyone can verify the tarballs offline, with no GitHub API call.
- name: Copy the provenance bundle
run: cp "$BUNDLE" "devstream-$GITHUB_REF_NAME.intoto.jsonl"
env:
BUNDLE: ${{ steps.attest.outputs.bundle-path }}
- name: Create the release
run: gh release create "$GITHUB_REF_NAME" --verify-tag --generate-notes "devstream-$GITHUB_REF_NAME.tar.gz" "devstream-site-$GITHUB_REF_NAME.tar.gz" "devstream-$GITHUB_REF_NAME.intoto.jsonl"
env:
GH_TOKEN: ${{ github.token }}