-
Notifications
You must be signed in to change notification settings - Fork 3
121 lines (104 loc) · 4.44 KB
/
release-please.yaml
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
on:
push:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: "always"
CARGO_INCREMENTAL: "0"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
# Rust version to use.
nightly: nightly-2024-08-01
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
release_please_output_json: ${{ toJSON(steps.release.outputs) }}
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
with:
token: ${{ secrets.RELEASE_TOKEN }}
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json
- name: Show outputs
env:
OUTPUTS: ${{ toJSON(steps.release.outputs) }}
run: echo "$OUTPUTS"
process-release:
runs-on: [ubuntu-22.04-github-hosted-32core]
container:
image: nvidia/cuda:12.5.0-devel-ubuntu20.04
env:
BELLMAN_CUDA_DIR: ${{ github.workspace }}/bellman-cuda
CUDAARCHS: 89
needs: [release-please]
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
steps:
- name: Prepare environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt update && apt install -y \
pkg-config libclang-dev build-essential lldb lld \
clang openssl libssl-dev gcc g++ wget curl jq
echo "/usr/local/nvidia/bin:/usr/local/cuda/bin" >> $GITHUB_PATH
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Setup CMake
run: |
curl -LO https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.sh && \
chmod +x cmake-3.24.3-linux-x86_64.sh && \
./cmake-3.24.3-linux-x86_64.sh --skip-license --prefix=/usr/local
- name: Prepare bellman-cuda directory
shell: bash
# Curl ugliness is required because gh can't work with authentication: https://github.com/cli/cli/issues/2680.
run: |
release=($(curl --silent https://api.github.com/repos/matter-labs/era-bellman-cuda/releases | jq -r '.[0] | .name, .tarball_url, .assets[0].browser_download_url'))
curl --silent -L "${release[1]}" --output bellman-cuda-source.tar.gz
curl --silent -L "${release[2]}" --output bellman-cuda.tar.gz
mkdir -p bellman-cuda
tar xvfz bellman-cuda.tar.gz -C ./bellman-cuda
tar xvfz bellman-cuda-source.tar.gz -C ./bellman-cuda --strip-components=1 --wildcards \*/src/
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.nightly }}
# Remove default `-D warnings`. This is a temporary measure.
rustflags: ""
- name: Install sccache
uses: mozilla-actions/[email protected]
- name: Install cargo-workspaces
run: cargo install cargo-workspaces
- name: Build each package separately
run: cargo ws exec cargo build
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish
run: cargo ws publish --publish-as-is --allow-dirty
- name: Set owners for new packages
# `cargo owner --add` fails if the package is already owned by the same entity,
# so we have to check if the package is already owned by the organization.
run: |
ORG_OWNER=github:matter-labs:crates-io
for PKG in $(cargo ws list); do
cargo owner --list --quiet $PKG | grep $ORG_OWNER || cargo owner --add $ORG_OWNER $PKG
done
- name: Send Release Info
uses: matter-labs/format-release-please-for-slack-action@69e6fe9e4ec531b7b5fb0d826f73c190db83cf42 # v2.1.0
with:
release-please-output: ${{ needs.release-please.outputs.release_please_output_json }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_RELEASES }}
- name: Notify about failure
if: failure()
uses: matter-labs/format-release-please-for-slack-action@69e6fe9e4ec531b7b5fb0d826f73c190db83cf42 # v2.1.0
with:
release-please-output: '{ "body": "⚠️ Failed to publish the release" }'
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_RELEASES }}