From ded8d19468437c10af8fb21f73af17c66ceebec3 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 20 Dec 2021 21:30:29 +0800 Subject: [PATCH 1/2] Update new template to use maturin for upload --- src/templates/CI.yml.j2 | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/templates/CI.yml.j2 b/src/templates/CI.yml.j2 index 4dadaf4f9..330f2582a 100644 --- a/src/templates/CI.yml.j2 +++ b/src/templates/CI.yml.j2 @@ -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 * From ab9a94b621e929f1f72f3a872ef8bfa729620c45 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 20 Dec 2021 21:30:49 +0800 Subject: [PATCH 2/2] Ignore keyring `PlatformFailure` --- src/upload.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/upload.rs b/src/upload.rs index f9342f316..73bfccca1 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -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) } @@ -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: {:?}",