From bc298c257046a832c03383ba05cbc9e4773dee05 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 3 Apr 2026 19:12:39 -0400 Subject: [PATCH 1/3] chore(ci): migrate to org reusable workflows Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/check.yml | 24 -------- .github/workflows/ci.yml | 2 +- .github/workflows/release-python.yml | 84 +--------------------------- .github/workflows/release-rust.yml | 10 ++-- 4 files changed, 10 insertions(+), 110 deletions(-) delete mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 2b1fd3a..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.14" - - 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-python.yml b/.github/workflows/release-python.yml index 0deb760..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.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/ diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 9843298..289109c 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -6,7 +6,7 @@ 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: @@ -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: dkdc-md-cli + last: "true" env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} - run: cargo publish -p dkdc-md-cli From 9ea6782e52b59c18a8fe9340b9a5e31e78420851 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 3 Apr 2026 19:22:46 -0400 Subject: [PATCH 2/3] chore: retrigger CI From 46716f09fa5b97eda79a1df99db4113d98d63842 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 3 Apr 2026 19:31:33 -0400 Subject: [PATCH 3/3] chore(ci): use org release-github.yml workflow Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release-github.yml | 84 +--------------------------- 1 file changed, 3 insertions(+), 81 deletions(-) diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index 54fbc8c..2c1124e 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -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/*