Use an action to publish the crate
This commit is contained in:
parent
f19ceeb8e0
commit
047129be9f
1 changed files with 16 additions and 16 deletions
32
.github/workflows/cpal.yml
vendored
32
.github/workflows/cpal.yml
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue