diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index c477ad8..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Check - -on: - workflow_call: - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.13" - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ~/.cache/uv - target - key: check-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', 'uv.lock') }} - restore-keys: check-${{ runner.os }}- - - run: bin/setup - - run: bin/check diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15bcf34..a467399 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,4 +8,4 @@ on: jobs: check: - uses: ./.github/workflows/check.yml + uses: dkdc-io/.github/.github/workflows/check.yml@v1 diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml new file mode 100644 index 0000000..73cae42 --- /dev/null +++ b/.github/workflows/release-github.yml @@ -0,0 +1,16 @@ +name: Release GitHub + +on: + push: + tags: ["v*.*.*"] + workflow_dispatch: + inputs: + tag: + description: "Tag to release (e.g. v0.1.0)" + required: true + +jobs: + release: + uses: dkdc-io/.github/.github/workflows/release-github.yml@v1 + permissions: + contents: write diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 829f334..88b6f8c 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -13,86 +13,8 @@ permissions: contents: read jobs: - check: - uses: ./.github/workflows/check.yml - - build: - name: Build (${{ matrix.target }}) - needs: check - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - - target: aarch64-unknown-linux-gnu - os: ubuntu-24.04-arm - - target: x86_64-apple-darwin - os: macos-latest - - target: aarch64-apple-darwin - os: macos-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.tag || github.ref }} - - uses: actions/setup-python@v5 - with: - python-version: "3.13" - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ~/.cache/uv - ~/Library/Caches/uv - key: wheel-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', 'uv.lock') }} - restore-keys: wheel-${{ matrix.target }}- - - run: bin/setup - - run: rustup target add ${{ matrix.target }} - - run: bin/build-wheels --target ${{ matrix.target }} --out dist - - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.target }} - path: dist/*.whl - if-no-files-found: error - - sdist: - name: Build sdist - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.tag || github.ref }} - - uses: actions/setup-python@v5 - with: - python-version: "3.13" - - uses: actions/cache@v4 - with: - path: ~/.cache/uv - key: sdist-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: sdist-${{ runner.os }}- - - run: bin/setup - - run: bin/build-sdist - - uses: actions/upload-artifact@v4 - with: - name: sdist - path: dist/*.tar.gz - if-no-files-found: error - - publish: - name: Publish to PyPI - needs: [build, sdist] - runs-on: ubuntu-latest - environment: pypi + release: + uses: dkdc-io/.github/.github/workflows/release-python.yml@v1 permissions: + contents: read id-token: write - steps: - - uses: actions/download-artifact@v4 - with: - path: dist - merge-multiple: true - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist/ diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 8a0c303..d4424a2 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -14,7 +14,7 @@ permissions: jobs: check: - uses: ./.github/workflows/check.yml + uses: dkdc-io/.github/.github/workflows/check.yml@v1 publish: name: Publish to crates.io @@ -37,7 +37,9 @@ jobs: restore-keys: crates-io- - uses: rust-lang/crates-io-auth-action@v1 id: auth - - name: Publish crates + - uses: dkdc-io/.github/actions/publish-crate@v1 + with: + crate: stringflow + last: "true" env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} - run: cargo publish -p stringflow || echo "stringflow already published, skipping" diff --git a/README.md b/README.md index 01e24ee..2d9e817 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# stringflow +# Stringflow + +[![crates.io](https://img.shields.io/crates/v/stringflow?color=blue)](https://crates.io/crates/stringflow) +[![PyPI](https://img.shields.io/pypi/v/stringflow?color=blue)](https://pypi.org/project/stringflow/) +[![CI](https://img.shields.io/github/actions/workflow/status/dkdc-io/stringflow/ci.yml?branch=main&label=CI)](https://github.com/dkdc-io/stringflow/actions/workflows/ci.yml) +[![License: MIT](https://img.shields.io/badge/license-MIT-8A2BE2.svg)](https://github.com/dkdc-io/stringflow/blob/main/LICENSE) Flow strings through language models.