Skip to content

Commit da00cc2

Browse files
chore(ci): migrate to org reusable workflows (#5)
* chore(ci): migrate to org reusable workflows Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: retrigger CI * chore(ci): use org release-github.yml workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 45518a2 commit da00cc2

5 files changed

Lines changed: 13 additions & 191 deletions

File tree

.github/workflows/check.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ on:
88

99
jobs:
1010
check:
11-
uses: ./.github/workflows/check.yml
11+
uses: dkdc-io/.github/.github/workflows/check.yml@v1

.github/workflows/release-github.yml

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -9,88 +9,10 @@ on:
99
description: "Tag to release (e.g. v0.1.0)"
1010
required: true
1111

12-
permissions:
13-
contents: read
14-
1512
jobs:
16-
check:
17-
uses: ./.github/workflows/check.yml
18-
19-
build:
20-
name: Build (${{ matrix.target }})
21-
needs: check
22-
runs-on: ${{ matrix.os }}
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
include:
27-
- target: x86_64-unknown-linux-gnu
28-
os: ubuntu-latest
29-
- target: aarch64-unknown-linux-gnu
30-
os: ubuntu-24.04-arm
31-
- target: x86_64-apple-darwin
32-
os: macos-latest
33-
- target: aarch64-apple-darwin
34-
os: macos-latest
35-
steps:
36-
- uses: actions/checkout@v4
37-
with:
38-
ref: ${{ github.event.inputs.tag || github.ref }}
39-
- uses: actions/setup-python@v5
40-
with:
41-
python-version: "3.14"
42-
- uses: actions/cache@v4
43-
with:
44-
path: |
45-
~/.cargo/registry
46-
~/.cargo/git
47-
~/.cache/uv
48-
~/Library/Caches/uv
49-
key: build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', 'uv.lock') }}
50-
restore-keys: build-${{ matrix.target }}-
51-
- run: bin/setup
52-
- run: rustup target add ${{ matrix.target }}
53-
- run: bin/build-rs --release --target ${{ matrix.target }}
54-
- name: Determine version
55-
id: tag
56-
run: |
57-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
58-
echo "version=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
59-
else
60-
echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
61-
fi
62-
- name: Package
63-
run: |
64-
staging=$(mktemp -d)
65-
cp target/${{ matrix.target }}/release/md "$staging/"
66-
cp LICENSE "$staging/"
67-
tar -czf dkdc-md-cli-${{ steps.tag.outputs.version }}-${{ matrix.target }}.tar.gz -C "$staging" .
68-
- uses: actions/upload-artifact@v4
69-
with:
70-
name: dkdc-md-cli-${{ matrix.target }}
71-
path: dkdc-md-cli-*.tar.gz
72-
if-no-files-found: error
73-
7413
release:
75-
name: Create Release
76-
needs: build
77-
runs-on: ubuntu-latest
14+
uses: dkdc-io/.github/.github/workflows/release-github.yml@v1
15+
with:
16+
binary: md
7817
permissions:
7918
contents: write
80-
steps:
81-
- name: Determine version
82-
id: tag
83-
run: |
84-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
85-
echo "version=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
86-
else
87-
echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
88-
fi
89-
- uses: actions/download-artifact@v4
90-
with:
91-
path: artifacts
92-
merge-multiple: true
93-
- name: Create GitHub Release
94-
env:
95-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96-
run: gh release create "${{ steps.tag.outputs.version }}" --repo "${{ github.repository }}" --title "${{ steps.tag.outputs.version }}" --generate-notes artifacts/*

.github/workflows/release-python.yml

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -13,86 +13,8 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
check:
17-
uses: ./.github/workflows/check.yml
18-
19-
build:
20-
name: Build (${{ matrix.target }})
21-
needs: check
22-
runs-on: ${{ matrix.os }}
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
include:
27-
- target: x86_64-unknown-linux-gnu
28-
os: ubuntu-latest
29-
- target: aarch64-unknown-linux-gnu
30-
os: ubuntu-24.04-arm
31-
- target: x86_64-apple-darwin
32-
os: macos-latest
33-
- target: aarch64-apple-darwin
34-
os: macos-latest
35-
steps:
36-
- uses: actions/checkout@v4
37-
with:
38-
ref: ${{ github.event.inputs.tag || github.ref }}
39-
- uses: actions/setup-python@v5
40-
with:
41-
python-version: "3.14"
42-
- uses: actions/cache@v4
43-
with:
44-
path: |
45-
~/.cargo/registry
46-
~/.cargo/git
47-
~/.cache/uv
48-
~/Library/Caches/uv
49-
key: wheel-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock', 'uv.lock') }}
50-
restore-keys: wheel-${{ matrix.target }}-
51-
- run: bin/setup
52-
- run: rustup target add ${{ matrix.target }}
53-
- run: bin/build-wheels --target ${{ matrix.target }} --out dist
54-
- uses: actions/upload-artifact@v4
55-
with:
56-
name: wheel-${{ matrix.target }}
57-
path: dist/*.whl
58-
if-no-files-found: error
59-
60-
sdist:
61-
name: Build sdist
62-
needs: check
63-
runs-on: ubuntu-latest
64-
steps:
65-
- uses: actions/checkout@v4
66-
with:
67-
ref: ${{ github.event.inputs.tag || github.ref }}
68-
- uses: actions/setup-python@v5
69-
with:
70-
python-version: "3.14"
71-
- uses: actions/cache@v4
72-
with:
73-
path: ~/.cache/uv
74-
key: sdist-${{ runner.os }}-${{ hashFiles('uv.lock') }}
75-
restore-keys: sdist-${{ runner.os }}-
76-
- run: bin/setup
77-
- run: bin/build-sdist
78-
- uses: actions/upload-artifact@v4
79-
with:
80-
name: sdist
81-
path: dist/*.tar.gz
82-
if-no-files-found: error
83-
84-
publish:
85-
name: Publish to PyPI
86-
needs: [build, sdist]
87-
runs-on: ubuntu-latest
88-
environment: pypi
16+
release:
17+
uses: dkdc-io/.github/.github/workflows/release-python.yml@v1
8918
permissions:
19+
contents: read
9020
id-token: write
91-
steps:
92-
- uses: actions/download-artifact@v4
93-
with:
94-
path: dist
95-
merge-multiple: true
96-
- uses: pypa/gh-action-pypi-publish@release/v1
97-
with:
98-
packages-dir: dist/

.github/workflows/release-rust.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ on:
66
workflow_dispatch:
77
inputs:
88
tag:
9-
description: "Tag to release (e.g. v0.1.0)"
9+
description: "Tag to release (e.g. v0.2.0)"
1010
required: true
1111

1212
permissions:
1313
contents: read
1414

1515
jobs:
1616
check:
17-
uses: ./.github/workflows/check.yml
17+
uses: dkdc-io/.github/.github/workflows/check.yml@v1
1818

1919
publish:
2020
name: Publish to crates.io
@@ -37,7 +37,9 @@ jobs:
3737
restore-keys: crates-io-
3838
- uses: rust-lang/crates-io-auth-action@v1
3939
id: auth
40-
- name: Publish crates
40+
- uses: dkdc-io/.github/actions/publish-crate@v1
41+
with:
42+
crate: dkdc-md-cli
43+
last: "true"
4144
env:
4245
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
43-
run: cargo publish -p dkdc-md-cli

0 commit comments

Comments
 (0)