Merge pull request #694 from Luni-4/publish

Use an action to publish the crate
This commit is contained in:
est31 2022-10-06 12:30:05 +02:00 • committed by GitHub
commit e5f459bd84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,28 +50,28 @@ jobs:
cargo-publish: cargo-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/master' if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Update apt - name: Update apt
run: sudo apt update run: sudo apt update
- name: Install alsa - name: Install alsa
run: sudo apt-get install libasound2-dev run: sudo apt-get install libasound2-dev
- name: Run cargo publish for cpal - name: Verify publish crate
continue-on-error: true uses: katyo/publish-crates@v1
run: | with:
CPAL_TMP=$(mktemp /tmp/cpalXXX.txt) || echo "::error::mktemp error" dry-run: true
echo "CPAL_TMP=$CPAL_TMP" >> $GITHUB_ENV - name: Publish crate
cargo publish --token $CRATESIO_TOKEN 2> $CPAL_TMP uses: katyo/publish-crates@v1
- name: Check if cpal is already published with:
run: | ignore-unpublished-changes: true
empty=0 registry-token: ${{ secrets.CRATESIO_TOKEN }}
CPAL_TMP="${{ env.CPAL_TMP }}"
grep -q '[^[:space:]]' < $CPAL_TMP || empty=1
[ $empty -eq 0 ] && cat $CPAL_TMP
[ $empty -eq 1 ] || grep -q "is already uploaded" < $CPAL_TMP
ubuntu-test: ubuntu-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest