Skip to content

fix(docs): update actions #26

fix(docs): update actions

fix(docs): update actions #26

Workflow file for this run

name: cli-ci
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
permissions:
contents: write
jobs:
build:
name: 'build ${{ matrix.target }}'
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# TODO: Implement https://github.com/doseiai/dosei/issues/62
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dsherret/rust-toolchain-file@v1
- name: Install ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Release
run: cargo build --package dosei --target ${{ matrix.target }} --release
- name: Zip (Linux/MacOS)
if: matrix.os != 'windows-latest'
run: zip -j dosei-${{ matrix.target }}.zip target/${{ matrix.target }}/release/dosei
- name: Zip (Windows)
if: matrix.os == 'windows-latest'
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/${{ matrix.target }}/release/dosei.exe -DestinationPath dosei-${{ matrix.target }}.zip
- name: Upload Zip
uses: actions/upload-artifact@v4
with:
name: dosei-${{ matrix.target }}
path: dosei-${{ matrix.target }}.zip
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
pattern: dosei-*
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
dosei-x86_64-unknown-linux-gnu.zip
dosei-x86_64-apple-darwin.zip
dosei-aarch64-apple-darwin.zip
dosei-x86_64-pc-windows-msvc.zip
- name: Print files sha256
run: |
shasum -a 256 \
dosei-x86_64-unknown-linux-gnu.zip \
dosei-x86_64-apple-darwin.zip \
dosei-aarch64-apple-darwin.zip \
dosei-x86_64-pc-windows-msvc.zip