Skip to content

Commit

Permalink
Merge pull request #752 from messense/maturin-upload
Browse files Browse the repository at this point in the history
Update new template to use maturin for upload
  • Loading branch information
messense authored Dec 20, 2021
2 parents fa66292 + ab9a94b commit d85d1a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 5 additions & 8 deletions src/templates/CI.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: {{ '${{ secrets.PYPI_PASSWORD }}' }}
run: |
pip install --upgrade twine
twine upload --skip-existing *
MATURIN_PYPI_TOKEN: {{ '${{ secrets.PYPI_API_TOKEN }}' }}
with:
command: upload
args: --skip-existing *
8 changes: 6 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ pub fn upload_ui(items: &[PathBuf], publish: &PublishOpt) -> Result<()> {
Ok(()) => {
println!("🔑 Removed wrong password from keyring")
}
Err(keyring::Error::NoEntry) | Err(keyring::Error::NoStorageAccess(_)) => {}
Err(keyring::Error::NoEntry)
| Err(keyring::Error::NoStorageAccess(_))
| Err(keyring::Error::PlatformFailure(_)) => {}
Err(err) => {
eprintln!("⚠️ Warning: Failed to remove password from keyring: {}", err)
}
Expand Down Expand Up @@ -383,7 +385,9 @@ pub fn upload_ui(items: &[PathBuf], publish: &PublishOpt) -> Result<()> {
let keyring = keyring::Entry::new(env!("CARGO_PKG_NAME"), &username);
let password = registry.password;
match keyring.set_password(&password) {
Ok(()) => {}
Ok(())
| Err(keyring::Error::NoStorageAccess(_))
| Err(keyring::Error::PlatformFailure(_)) => {}
Err(err) => {
eprintln!(
"⚠️ Warning: Failed to store the password in the keyring: {:?}",
Expand Down

0 comments on commit d85d1a0

Please sign in to comment.