v0.4.3 #3
Workflow file for this run
This file contains 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
name: Publish CI artifacts | |
# rust build jobs based off of [hyperfine's CI](https://github.com/sharkdp/hyperfine/blob/e8ff88dad130d4b4bc2362be92aa8dfedc35074a/.github/workflows/CICD.yml#L71-L84) | |
# Linker Rustflags [just's ci](https://github.com/casey/just/blob/b4efe2628a8d0e8f936498f5ac5fd5764f4063f8/.github/workflows/release.yaml) | |
on: | |
push: | |
tags: ['v*'] | |
workflow_dispatch: | |
env: | |
CICD_INTERMEDIATES_DIR: '_cicd-intermediates' | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
publish-server: | |
permissions: | |
contents: write | |
id-token: write | |
if: startsWith(github.ref, 'refs/tags/') | |
name: Publish Server to RubyGems | |
runs-on: ubuntu-latest | |
defaults: { run: { working-directory: server } } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rubygems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1.4' | |
bundler-cache: true | |
working-directory: server | |
- name: Release server gem | |
uses: rubygems/release-gem@v1 | |
publish-client-go: | |
name: Check Go Client | |
runs-on: ubuntu-latest | |
defaults: { run: { working-directory: client-go } } | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.2' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build go client | |
run: | | |
go mod tidy | |
go mod vendor | |
go build | |
go install | |
# go test | |
lint-format-client-rs: | |
name: Lint and Format rust client | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: client-rs | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: client-rs | |
- name: Install protobuf | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: protoc | |
- name: Lint | |
run: cargo clippy --no-deps --all-targets -- -D warnings | |
- name: Format | |
run: cargo fmt --check | |
build-client-rs: | |
name: Build rust client for ${{ matrix.job.target }} (on ${{ matrix.job.os }}) | |
needs: [lint-format-client-rs, create-release] | |
runs-on: ${{ matrix.job.os }} | |
defaults: { run: { working-directory: client-rs } } | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: aarch64-unknown-linux-musl | |
os: ubuntu-latest | |
on-pr: true | |
- target: aarch64-apple-darwin | |
os: macos-14 | |
on-pr: true | |
- target: arm-unknown-linux-gnueabihf | |
os: ubuntu-latest | |
- target: arm-unknown-linux-musleabihf | |
os: ubuntu-latest | |
- target: i686-pc-windows-msvc | |
os: windows-2019 | |
- target: i686-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: i686-unknown-linux-musl | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-13 | |
- target: x86_64-pc-windows-msvc | |
os: windows-2019 | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
on-pr: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install protobuf,cargo-zigbuild,just | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-zigbuild, protoc,just | |
- name: Install zig | |
uses: mlugg/setup-zig@v1 | |
- name: Install Rust toolchain | |
id: rust-toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.job.target }} | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: client-rs | |
key: os-${{ matrix.job.os }}-target-${{ matrix.job.target }}-rust-${{ steps.rust-toolchain.outputs.toolchain }} | |
- name: Upload rust binary | |
uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
locked: true | |
bin: asciidoctor-client | |
target: ${{ matrix.job.target }} | |
token: ${{ secrets.GITHUB_TOKEN }} |