ci: 💚 fix build ci #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CODEGEN AND PUBLISH | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [ "master" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
codegen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: arduino/setup-protoc@v3 | |
- name: install fd, sd, ripgrep | |
run: | | |
sudo apt-get install -y ripgrep | |
export FD_VER=10.2.0 | |
export SD_VER=1.0.0 | |
curl -sSL "https://github.com/sharkdp/fd/releases/download/v${FD_VER}/fd-v${FD_VER}-x86_64-unknown-linux-musl.tar.gz" \ | |
| tar xz --strip-components=1 -C /usr/local/bin/ | |
curl -sSL "https://github.com/chmln/sd/releases/download/v${SD_VER}/sd-v${SD_VER}-x86_64-unknown-linux-musl.tar.gz" \ | |
| tar xz --strip-components=1 -C /usr/local/bin/ | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: just protos | |
crates_io_publish: | |
name: Publish (crates.io) | |
needs: | |
- codegen | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: cargo-release Cache | |
id: cargo_release_cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/bin/cargo-release | |
key: ${{ runner.os }}-cargo-release | |
- run: cargo install cargo-release | |
if: steps.cargo_release_cache.outputs.cache-hit != 'true' | |
- name: cargo login | |
run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }} | |
- name: "cargo release publish" | |
run: |- | |
cargo release \ | |
publish \ | |
--package \ | |
k8s-rs-pb \ | |
--no-confirm \ | |
--execute | |
cargo logout | |