blob: 0bf1cb5c1a912e5fbfb1318c822dc7c6ead837f9 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Bootstrap Rust Crates
run-name: Bootstrap Rust crates at ${{ github.sha }}
on:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: bootstrap-rust-crates
cancel-in-progress: false
jobs:
discover:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
ref: ${{ github.sha }}
- name: Validate main dispatch
run: |
set -euo pipefail
if [[ "${GITHUB_REF}" != "refs/heads/main" ]]; then
echo "Bootstrap Rust Crates must be dispatched from main" >&2
exit 1
fi
test "$(git rev-parse HEAD)" = "${GITHUB_SHA}"
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Discover Rust crates
run: python3 .github/scripts/release_rust/bootstrap.py discover
bootstrap:
needs: discover
runs-on: ubuntu-latest
environment: rust-bootstrap
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
ref: ${{ github.sha }}
- name: Validate main dispatch
run: |
set -euo pipefail
if [[ "${GITHUB_REF}" != "refs/heads/main" ]]; then
echo "Bootstrap Rust Crates must be dispatched from main" >&2
exit 1
fi
test "$(git rev-parse HEAD)" = "${GITHUB_SHA}"
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Audit and bootstrap crates.io packages
env:
CARGO_REGISTRY_BOOTSTRAP_TOKEN: ${{ secrets.CARGO_REGISTRY_BOOTSTRAP_TOKEN }}
run: python3 .github/scripts/release_rust/bootstrap.py apply