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:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
runs-on: ubuntu-latest
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
run: sudo apt update
- name: Install alsa
run: sudo apt-get install libasound2-dev
- name: Run cargo publish for cpal
continue-on-error: true
run: |
CPAL_TMP=$(mktemp /tmp/cpalXXX.txt) || echo "::error::mktemp error"
echo "CPAL_TMP=$CPAL_TMP" >> $GITHUB_ENV
cargo publish --token $CRATESIO_TOKEN 2> $CPAL_TMP
- name: Check if cpal is already published
run: |
empty=0
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
- name: Verify publish crate
uses: katyo/publish-crates@v1
with:
dry-run: true
- name: Publish crate
uses: katyo/publish-crates@v1
with:
ignore-unpublished-changes: true
registry-token: ${{ secrets.CRATESIO_TOKEN }}
ubuntu-test:
runs-on: ubuntu-latest