Update CI workflow

This commit is contained in:
Andrew Cassidy 2024-06-18 20:32:41 -07:00
parent c3cd57621f
commit 8649f2e949

View File

@ -6,23 +6,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout Repo - name: checkout Repo
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 if: github.event_name == 'push' && github.ref_type == 'tag'
uses: actions/setup-python@v5
with: with:
python-version: '3.x' python-version: '3.12'
- name: Setup Python Tools - name: Setup Yaclog
run: if: github.event_name == 'push' && github.ref_type == 'tag'
run: |
pip install yaclog~=1.1 pip install yaclog~=1.1
yaclog show
- name: Setup Rust toolchain - name: Rust setup
uses: actions-rs/toolchain@v1 run: rustup toolchain install stable --profile minimal --component rustfmt
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: Run Checks - name: Run Checks
run: | run: |
@ -32,21 +31,18 @@ jobs:
- name: Run Unit Tests - name: Run Unit Tests
run: cargo test 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 - name: Publish to Crates.io
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') if: github.event_name == 'push'
run: cargo publish --token ${{ secrets.CARGO_TOKEN }} run: |
cargo publish \
--token ${{ secrets.CARGO_TOKEN }} \
${{ github.ref_type != 'tag' && '--dry-run' || '' }}
- name: Publish to Github - name: Publish to Github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') if: github.event_name == 'push' && github.ref_type == 'tag'
uses: ncipollo/release-action@v1 run: |
with: gh release create ${{ github.ref_name }} \
name: Version ${{ env.VERSION_TITLE }} --notes "$(yaclog show -mb)" \
bodyfile: /tmp/RELEASE.md --title "Version $(yaclog show -n)"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}