Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr0id authored Sep 30, 2024
1 parent e1a1def commit cafd1b1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,25 @@ jobs:
fi
cat Cargo.toml
- name: Debug Token
run: |
echo "CRATES_IO_TOKEN is set: ${{ secrets.CRATES_IO_TOKEN != '' }}"
echo "CRATES_IO_TOKEN length: ${#CRATES_IO_TOKEN}"
echo "CARGO_REGISTRY_TOKEN is set: ${{ env.CARGO_REGISTRY_TOKEN != '' }}"
echo "CARGO_REGISTRY_TOKEN length: ${#CARGO_REGISTRY_TOKEN}"
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
echo "CARGO_REGISTRY_TOKEN length: ${#CARGO_REGISTRY_TOKEN}"
echo "CARGO_REGISTRY_TOKEN length in publish step: ${#CARGO_REGISTRY_TOKEN}"
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
cargo publish --token "${CARGO_REGISTRY_TOKEN}"
cargo publish --token "$CARGO_REGISTRY_TOKEN" || cargo publish --token "$CARGO_REGISTRY_TOKEN" --verbose
elif [[ "${{ github.ref }}" == refs/heads/master ]]; then
cargo publish --token "${CARGO_REGISTRY_TOKEN}" --allow-dirty
cargo publish --token "$CARGO_REGISTRY_TOKEN" --allow-dirty || cargo publish --token "$CARGO_REGISTRY_TOKEN" --allow-dirty --verbose
else
echo "Not publishing: not a push to master or a tag"
fi

0 comments on commit cafd1b1

Please sign in to comment.