From 524bbb9ef57665e85569e3e0fddfc9e99f98ff37 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Sat, 26 Oct 2019 17:09:42 +0200 Subject: [PATCH] Check cargo-publish error type --- .github/workflows/cpal.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpal.yml b/.github/workflows/cpal.yml index f9fb8b9..ad2834e 100644 --- a/.github/workflows/cpal.yml +++ b/.github/workflows/cpal.yml @@ -28,19 +28,39 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/master' + env: + CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} + ALSA: alsa-sys.txt + CPAL: cpal.txt + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Install alsa run: sudo apt-get install libasound2-dev - - name: Run cargo publish + - name: Run cargo publish for alsa-sys + continue-on-error: true env: MANIFEST: alsa-sys/Cargo.toml - CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} run: | - cargo publish --token $CRATESIO_TOKEN --manifest-path $MANIFEST - cargo publish --token $CRATESIO_TOKEN + cargo publish --token $CRATESIO_TOKEN --manifest-path $MANIFEST 2> $ALSA + - name: Check if alsa-sys is already published + run: | + empty=0 + grep -q '[^[:space:]]' < $ALSA || empty=1 + [ $empty -eq 0 ] && cat $ALSA + [ $empty -eq 1 ] || grep -q "is already uploaded" < $ALSA + - name: Run cargo publish for cpal + continue-on-error: true + run: | + cargo publish --token $CRATESIO_TOKEN 2> $CPAL + - name: Check if cpal is already published + run: | + empty=0 + grep -q '[^[:space:]]' < $CPAL || empty=1 + [ $empty -eq 0 ] && cat $CPAL + [ $empty -eq 1 ] || grep -q "is already uploaded" < $CPAL ubuntu-test: