Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub release + PyPi publishing #137

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ name: Release

on:
push:
# branches:
# - main
# - master
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
inputs:
tag:
description: 'Semantic version for PyPI release (tag will share the same name)'
required: true
default: 'v0.1.0'

permissions:
contents: read
Expand Down Expand Up @@ -160,41 +161,38 @@ jobs:
release-pypi:
name: Release PyPi
runs-on: ubuntu-latest
if: false # ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, musllinux, windows, macos, sdist]
if: ${{ github.event_name == 'workflow_dispatch' }}
needs: [github-release]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
environment: release
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'wheels-*/*'
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*

release-github:
name: Release GitHub
github-release:
name: Create GitHub release
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
if: ${{ github.event_name == 'workflow_dispatch' }}
needs: [ linux, musllinux, windows, macos, sdist ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Publish to GitHub Releases
env:
GH_TOKEN: ${{ github.token }}
- name: Create GitHub Release
run: |
gh release upload ${{github.event.release.tag_name}} wheels-*/*
gh release create ${{ github.event.inputs.tag}} wheels-*/* --generate-notes --draft --prerelease
1 change: 1 addition & 0 deletions hf_xet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "hf_xet"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand Down
2 changes: 1 addition & 1 deletion hf_xet/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"

[project]
name = "hfxet"
name = "hf-xet"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Rust",
Expand Down
Loading