Skip to content

refactor: Use io::Result instead of anyhow in gen mod #92

refactor: Use io::Result instead of anyhow in gen mod

refactor: Use io::Result instead of anyhow in gen mod #92

name: release-please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- id: release
uses: google-github-actions/release-please-action@v3
with:
package-name: man-completions
release-type: rust
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
# Publish to Cargo if release created
- run: cargo publish --verbose --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: release-please
if: needs.release-please.outputs.release_created
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- run: cargo build --release
- run: mv ./target/release/man-completions ./man-completions-${{ matrix.os }}
- name: Upload executable for ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.tag_name }} ./man-completions-${{ matrix.os }}