-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (102 loc) · 3.42 KB
/
Copy pathrelease-artifacts.yml
File metadata and controls
107 lines (102 loc) · 3.42 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
name: Release artifacts
on:
workflow_dispatch:
push:
tags: ["v*"]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- runner: macos-15-intel
target: x86_64-apple-darwin
- runner: macos-15
target: aarch64-apple-darwin
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
workspaces: |
. -> target
servers -> servers/target
- name: Build versioned native bundle
run: cargo run --release --manifest-path tools/release-tool/Cargo.toml --locked -- --target "${{ matrix.target }}"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: timeless-telemetry-data-plane-${{ matrix.target }}
path: dist/*.tar.gz
if-no-files-found: error
checksums:
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: timeless-telemetry-data-plane-*
merge-multiple: true
path: dist
- name: Produce complete release checksum set
run: |
cd dist
sha256sum *.tar.gz | sort -k2 > SHA256SUMS
sha256sum -c SHA256SUMS
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: timeless-telemetry-data-plane-checksums
path: dist/SHA256SUMS
if-no-files-found: error
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: checksums
permissions:
actions: read
contents: write
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: timeless-telemetry-data-plane-*
merge-multiple: true
path: dist
- name: Verify complete release asset set
shell: bash
run: |
set -euo pipefail
cd dist
mapfile -t archives < <(find . -maxdepth 1 -type f -name '*.tar.gz' -printf '%f\n' | sort)
test "${#archives[@]}" -eq 4
test "$(wc -l < SHA256SUMS)" -eq 4
sha256sum -c SHA256SUMS
- name: Resolve previous release tag
id: previous
shell: bash
run: |
previous_tag="$(git describe --tags --abbrev=0 "${GITHUB_SHA}^")"
echo "tag=${previous_tag}" >> "${GITHUB_OUTPUT}"
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: >-
gh release create "${GITHUB_REF_NAME}"
dist/*.tar.gz dist/SHA256SUMS
--verify-tag
--fail-on-no-commits
--generate-notes
--notes-start-tag "${{ steps.previous.outputs.tag }}"
--title "${GITHUB_REF_NAME}"
--latest