vector-victor/.github/workflows/cargo-test-publish.yaml

48 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2023-05-02 07:07:33 +00:00
name: Build and Release
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout Repo
2024-06-19 03:32:41 +00:00
uses: actions/checkout@v4
2023-05-02 07:07:33 +00:00
- name: Setup Python
2024-06-19 03:32:41 +00:00
if: github.event_name == 'push' && github.ref_type == 'tag'
uses: actions/setup-python@v5
2023-05-02 07:07:33 +00:00
with:
2024-06-19 03:32:41 +00:00
python-version: '3.12'
2023-05-02 07:07:33 +00:00
2024-06-19 03:32:41 +00:00
- name: Setup Yaclog
if: github.event_name == 'push' && github.ref_type == 'tag'
run: |
2023-05-02 07:07:33 +00:00
pip install yaclog~=1.1
2024-06-19 03:32:41 +00:00
yaclog show
2023-05-02 07:07:33 +00:00
2024-06-19 03:32:41 +00:00
- name: Rust setup
2024-06-19 04:36:26 +00:00
run: rustup toolchain install stable --profile minimal
2023-05-02 07:07:33 +00:00
- name: Run Checks
run: |
cargo check
- name: Run Unit Tests
run: cargo test
- name: Publish to Crates.io
2024-06-19 03:32:41 +00:00
if: github.event_name == 'push'
run: |
cargo publish \
--token ${{ secrets.CARGO_TOKEN }} \
${{ github.ref_type != 'tag' && '--dry-run' || '' }}
2023-05-02 07:07:33 +00:00
- name: Publish to Github
2024-06-19 03:32:41 +00:00
if: github.event_name == 'push' && github.ref_type == 'tag'
run: |
gh release create ${{ github.ref_name }} \
--notes "$(yaclog show -mb)" \
--title "Version $(yaclog show -n)"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}