You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB
YAML

name: Build and Release
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout Repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup Python Tools
run:
pip install yaclog~=1.1
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: Run Checks
run: |
cargo check
cargo fmt --check
- name: Run Unit Tests
run: cargo test
- name: Generate changelog info
continue-on-error: true
run: |
# todo: make this part of yaclog!
echo "VERSION_TITLE=$(yaclog show -n)" >> $GITHUB_ENV
echo "$(yaclog show -mb)" >> /tmp/RELEASE.md
yaclog show
- name: Publish to Crates.io
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
- name: Publish to Github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: ncipollo/release-action@v1
with:
name: Version ${{ env.VERSION_TITLE }}
bodyfile: /tmp/RELEASE.md