Skip to content

Commit 8e50bbe

Browse files
committed
more progress
1 parent ecd771c commit 8e50bbe

File tree

8 files changed

+126
-125
lines changed

8 files changed

+126
-125
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
image: instrumentisto/rust
1+
image: rust:latest
22
source_files: "@rust"
33

44
steps:
5+
- run:
6+
name: Install clippy
7+
command: rustup component add clippy
58
- run:
69
name: Clippy check
710
command: cargo clippy --all-targets --all-features -- -D warnings

.cigen/workflows/ci/jobs/fmt.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
image: instrumentisto/rust
1+
image: rust:latest
22
source_files: "@rust"
33

44
steps:
5+
- run:
6+
name: Install rustfmt
7+
command: rustup component add rustfmt
58
- run:
69
name: Format check
710
command: cargo fmt -- --check

.cigen/workflows/ci/jobs/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: instrumentisto/rust
1+
image: rust:latest
22
source_files:
33
- "@rust"
44
- "@tests"

.github/workflows/ci.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,26 @@
44
#
55
name: CI
66
on:
7+
pull_request: {}
78
push:
89
branches:
910
- main
10-
pull_request: {}
1111
jobs:
12+
fmt:
13+
runs-on: ubuntu-latest
14+
container:
15+
image: rust:latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
- name: Install rustfmt
20+
run: rustup component add rustfmt
21+
- name: Format check
22+
run: cargo fmt -- --check
1223
test:
1324
runs-on: ubuntu-latest
1425
container:
15-
image: instrumentisto/rust
26+
image: rust:latest
1627
steps:
1728
- name: Checkout code
1829
uses: actions/checkout@v4
@@ -21,18 +32,11 @@ jobs:
2132
clippy:
2233
runs-on: ubuntu-latest
2334
container:
24-
image: instrumentisto/rust
35+
image: rust:latest
2536
steps:
2637
- name: Checkout code
2738
uses: actions/checkout@v4
39+
- name: Install clippy
40+
run: rustup component add clippy
2841
- name: Clippy check
2942
run: cargo clippy --all-targets --all-features -- -D warnings
30-
fmt:
31-
runs-on: ubuntu-latest
32-
container:
33-
image: instrumentisto/rust
34-
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v4
37-
- name: Format check
38-
run: cargo fmt -- --check

.github/workflows/docs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ on:
99
branches:
1010
- main
1111
jobs:
12-
deploy:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
17-
- uses: actions/deploy-pages@v4
1812
ci_gate:
1913
runs-on: ubuntu-latest
2014
steps:
@@ -77,3 +71,9 @@ jobs:
7771
with:
7872
path: |
7973
docs/dist
74+
deploy:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v4
79+
- uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 87 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,65 @@
1-
name: release
1+
# DO NOT EDIT - This file is generated by cigen
2+
# Source: .cigen/workflows/
3+
# Regenerate with: cargo run -- --config .cigen generate
4+
#
5+
name: RELEASE
26
on:
37
push:
4-
tags:
5-
- v*
6-
workflow_dispatch: {}
7-
permissions:
8-
contents: write
8+
branches:
9+
- main
10+
pull_request: {}
911
jobs:
10-
release_create:
12+
docker_image:
1113
runs-on: ubuntu-latest
12-
needs:
13-
- release_build
1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
17-
- name: Checkout repository
18-
uses: actions/checkout@v4
17+
- uses: actions/checkout@v4
1918
with:
20-
fetch-tags: true
21-
fetch-depth: 0
22-
- name: Download artifacts
23-
uses: actions/download-artifact@v4
19+
fetch-depth: |
20+
0
21+
- run: |
22+
VERSION=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
23+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
24+
- uses: docker/setup-qemu-action@v3
25+
- uses: docker/setup-buildx-action@v3
26+
- uses: docker/login-action@v3
2427
with:
25-
path: artifacts
26-
- id: version
27-
name: Get version from Cargo.toml
28+
password: |
29+
${{ env.DOCKERHUB_TOKEN }}
30+
username: |
31+
${{ env.DOCKERHUB_USERNAME }}
32+
- name: Build and push multi-arch image
2833
run: |
34+
set -euo pipefail
35+
VERSION="${{ steps.v.outputs.version }}"
36+
echo "Building docspringcom/cigen:${VERSION} and :latest"
37+
docker buildx build \
38+
--platform linux/amd64,linux/arm64 \
39+
-f Dockerfile \
40+
--build-arg CIGEN_VERSION="${VERSION}" \
41+
-t docspringcom/cigen:"${VERSION}" \
42+
-t docspringcom/cigen:latest \
43+
--push .
44+
env:
45+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
46+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
47+
release_create:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
- uses: actions/checkout@v4
53+
with:
54+
fetch-tags: |
55+
true
56+
fetch-depth: |
57+
0
58+
- uses: actions/download-artifact@v4
59+
with:
60+
path: |
61+
artifacts
62+
- run: |
2963
VERSION=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
3064
{
3165
echo "version=$VERSION"
@@ -78,98 +112,46 @@ jobs:
78112
- Linux (x86_64): https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/cigen-linux-amd64.tar.gz
79113
- Linux (ARM64): https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/cigen-linux-arm64.tar.gz
80114
EOF
81-
- name: Create GitHub Release
82-
uses: softprops/action-gh-release@v2
115+
- uses: softprops/action-gh-release@v2
83116
with:
84-
tag_name: ${{ steps.version.outputs.tag }}
85-
prerelease: ${{ contains(steps.version.outputs.tag, '-') }}
86-
body_path: changelog.md
87-
name: CIGen v${{ steps.version.outputs.version }}
88-
draft: false
117+
prerelease: |
118+
${{ contains(steps.version.outputs.tag, '-') }}
89119
files: |
90-
artifacts/**/*.tar.gz
91-
artifacts/**/*.sha256
92-
docker_image:
93-
runs-on: ubuntu-latest
94-
needs:
95-
- release_create
96-
steps:
97-
- name: Checkout code
98-
uses: actions/checkout@v4
99-
- name: Checkout repository
100-
uses: actions/checkout@v4
101-
with:
102-
fetch-depth: 0
103-
- id: v
104-
name: Extract version
105-
run: |
106-
VERSION=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
107-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
108-
- name: Set up QEMU
109-
uses: docker/setup-qemu-action@v3
110-
- name: Set up Docker Buildx
111-
uses: docker/setup-buildx-action@v3
112-
- name: Log in to Docker Hub
113-
uses: docker/login-action@v3
114-
with:
115-
username: ${{ env.DOCKERHUB_USERNAME }}
116-
password: ${{ env.DOCKERHUB_TOKEN }}
117-
- name: Build and push multi-arch image
118-
run: |
119-
set -euo pipefail
120-
VERSION="${{ steps.v.outputs.version }}"
121-
echo "Building docspringcom/cigen:${VERSION} and :latest"
122-
docker buildx build \
123-
--platform linux/amd64,linux/arm64 \
124-
-f Dockerfile \
125-
--build-arg CIGEN_VERSION="${VERSION}" \
126-
-t docspringcom/cigen:"${VERSION}" \
127-
-t docspringcom/cigen:latest \
128-
--push .
129-
env:
130-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
131-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
132-
permissions:
133-
contents: read
120+
|
121+
artifacts/**/*.tar.gz
122+
artifacts/**/*.sha256
123+
tag_name: |
124+
${{ steps.version.outputs.tag }}
125+
draft: |
126+
false
127+
name: |
128+
CIGen v${{ steps.version.outputs.version }}
129+
body_path: |
130+
changelog.md
134131
release_build:
135-
runs-on: ${{ matrix.os }}
136-
strategy:
137-
matrix:
138-
include:
139-
- name: cigen-macos-amd64
140-
os: macos-latest
141-
target: x86_64-apple-darwin
142-
- name: cigen-macos-arm64
143-
os: macos-latest
144-
target: aarch64-apple-darwin
145-
- name: cigen-linux-amd64
146-
os: ubuntu-latest
147-
target: x86_64-unknown-linux-gnu
148-
- name: cigen-linux-arm64
149-
os: ubuntu-latest
150-
target: aarch64-unknown-linux-gnu
151-
use-cross: true
152-
fail-fast: false
132+
runs-on: ubuntu-latest
133+
container:
134+
image: ${{ matrix.os }}
153135
steps:
154136
- name: Checkout code
155137
uses: actions/checkout@v4
156-
- name: Checkout repository
157-
uses: actions/checkout@v4
138+
- uses: actions/checkout@v4
158139
with:
159-
fetch-depth: 0
160-
fetch-tags: true
161-
- name: Wait for required checks
162-
uses: actions/github-script@v7
140+
fetch-tags: |
141+
true
142+
fetch-depth: |
143+
0
144+
- uses: actions/github-script@v7
163145
with:
164146
script: |
165-
const script = require('./.github/wait-for-checks.js');
166-
await script({ github, context, core });
167-
- name: Install Rust
168-
uses: dtolnay/rust-toolchain@stable
147+
|
148+
const script = require('./.github/wait-for-checks.js');
149+
await script({ github, context, core });
150+
- uses: dtolnay/rust-toolchain@stable
169151
with:
170-
targets: ${{ matrix.target }}
171-
- name: Install cross (for cross-compilation)
172-
run: cargo install cross --git https://github.com/cross-rs/cross
152+
targets: |
153+
${{ matrix.target }}
154+
- run: cargo install cross --git https://github.com/cross-rs/cross
173155
- name: Build binary
174156
run: |
175157
set -e
@@ -185,8 +167,9 @@ jobs:
185167
tar czf "../../../${{ matrix.name }}.tar.gz" cigen
186168
cd ../../../
187169
echo "ASSET_PATH=${{ matrix.name }}.tar.gz" >> "$GITHUB_ENV"
188-
- name: Upload artifact
189-
uses: actions/upload-artifact@v4
170+
- uses: actions/upload-artifact@v4
190171
with:
191-
path: ${{ env.ASSET_PATH }}
192-
name: ${{ matrix.name }}
172+
name: |
173+
${{ matrix.name }}
174+
path: |
175+
${{ env.ASSET_PATH }}

Taskfile.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ tasks:
6868
desc: Update dependencies
6969
cmds:
7070
- cargo update
71+
72+
# Generate workflows and test with act
73+
act:
74+
desc: Generate CI workflows and test locally with act
75+
cmds:
76+
- cargo run -- generate
77+
- act -W .github/workflows/ci.yml --container-architecture linux/amd64

docs/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

0 commit comments

Comments
 (0)