-
Notifications
You must be signed in to change notification settings - Fork 5
105 lines (91 loc) · 3.11 KB
/
release-rust-crates.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
name: Rust Package
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
ref:
description: 'The reference (branch/tag/commit) to checkout'
required: false
release-type:
type: choice
required: false
default: 'none'
description: 'Indicates whether we want to make a release and if which one'
options:
- release
- none
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && 'manual' || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: linux-arm64
- target: x86_64-apple-darwin
os: macos-13
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-gnu
os: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build
run: cargo build --target ${{ matrix.target }} --verbose
- name: Run tests
run: RUST_BACKTRACE=1 cargo test --target ${{ matrix.target }}
shell: bash
# We really only want to publish the eip7594 crate
# However, crates.io forces us to publish its dependencies too.
publish:
name: Publish in order
needs: build-and-test
if: ${{ inputs.release-type != 'none' && github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
# These steps are in a specific order so crate dependencies are updated first
- name: Publish bls12_381
run: cargo publish --package crate_crypto_internal_eth_kzg_bls12_381
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
- name: Publish polynomial
run: cargo publish --package crate_crypto_internal_eth_kzg_polynomial
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
- name: Publish erasure_codes
run: cargo publish --package crate_crypto_internal_eth_kzg_erasure_codes
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
- name: Publish kzg_multi_open
run: cargo publish --package crate_crypto_kzg_multi_open_fk20
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
- name: Publish rust_eth_kzg
run: cargo publish --package rust_eth_kzg
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }}