Skip to content
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
24 changes: 0 additions & 24 deletions .github/workflows/check.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ on:

jobs:
check:
uses: ./.github/workflows/check.yml
uses: dkdc-io/.github/.github/workflows/check.yml@v1
84 changes: 3 additions & 81 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,88 +9,10 @@ on:
description: "Tag to release (e.g. v0.1.0)"
required: true

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.14"
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cache/uv
~/Library/Caches/uv
key: build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', 'uv.lock') }}
restore-keys: build-${{ matrix.target }}-
- run: bin/setup
- run: rustup target add ${{ matrix.target }}
- run: bin/build-rs --release --target ${{ matrix.target }}
- name: Determine version
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Package
run: |
staging=$(mktemp -d)
cp target/${{ matrix.target }}/release/md "$staging/"
cp LICENSE "$staging/"
tar -czf dkdc-md-cli-${{ steps.tag.outputs.version }}-${{ matrix.target }}.tar.gz -C "$staging" .
- uses: actions/upload-artifact@v4
with:
name: dkdc-md-cli-${{ matrix.target }}
path: dkdc-md-cli-*.tar.gz
if-no-files-found: error

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
uses: dkdc-io/.github/.github/workflows/release-github.yml@v1
with:
binary: md
permissions:
contents: write
steps:
- name: Determine version
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ steps.tag.outputs.version }}" --repo "${{ github.repository }}" --title "${{ steps.tag.outputs.version }}" --generate-notes artifacts/*
84 changes: 3 additions & 81 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.14"
- 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.14"
- 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/
10 changes: 6 additions & 4 deletions .github/workflows/release-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v0.1.0)"
description: "Tag to release (e.g. v0.2.0)"
required: true

permissions:
contents: read

jobs:
check:
uses: ./.github/workflows/check.yml
uses: dkdc-io/.github/.github/workflows/check.yml@v1

publish:
name: Publish to crates.io
Expand All @@ -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: dkdc-md-cli
last: "true"
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish -p dkdc-md-cli
Loading