Skip to content
Closed
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
10 changes: 4 additions & 6 deletions cedar.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: cedar
version: 2.3.2
epoch: 0
epoch: 1
description: "Core implementation of the Cedar language"
copyright:
- license: Apache-2.0
Expand All @@ -22,11 +22,9 @@ pipeline:
expected-commit: e23299526851f08d816b3df720c7219802458a53
tag: v${{package.version}}

- name: Configure and build
runs: |
cargo build --release -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/cedar ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: cedar

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions deno.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: deno
version: 1.36.1
epoch: 0
epoch: 1
description: "A modern runtime for JavaScript and TypeScript."
copyright:
- license: MIT
Expand All @@ -27,11 +27,9 @@ pipeline:
uri: https://github.com/denoland/deno/releases/download/v${{package.version}}/deno_src.tar.gz
expected-sha256: d3262bb024eb4aacf2090cdca66059a90a3176c07ebe1fcc0abcd4d83f2b047c

- name: Configure and build
runs: |
cargo build --release -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/deno ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: deno

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions just.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: just
version: 1.14.0
epoch: 0
epoch: 1
description: "just is a handy way to save and run project-specific commands."
copyright:
- license: CC0
Expand All @@ -22,11 +22,9 @@ pipeline:
expected-commit: 8e3a2a088213692f874ae9314e5ecd9ed56e2bc6
tag: ${{package.version}}

- name: Configure and build
runs: |
cargo build --release
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/just ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: just

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions mdbook.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: mdbook
version: 0.4.34
epoch: 0
epoch: 1
description: "Create book from markdown files. Like Gitbook but implemented in Rust."
copyright:
- license: MPL-2.0
Expand All @@ -27,11 +27,9 @@ pipeline:
tag: v${{package.version}}
expected-commit: 56c225bd34760eb6de024b67b42729e4a55b6302

- name: Configure and build
runs: |
cargo build --release
install -d "${{targets.destdir}}"/usr/bin
install -m755 target/release/mdbook "${{targets.destdir}}"/usr/bin/
- uses: rust/cargo-build
with:
target: mdbook

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions meilisearch.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: meilisearch
version: 1.3.1
epoch: 0
epoch: 1
description: "A lightning-fast search engine that fits effortlessly into your apps, websites, and workflow."
copyright:
- license: MIT
Expand All @@ -21,11 +21,9 @@ pipeline:
uri: https://github.com/meilisearch/meilisearch/archive/refs/tags/v${{package.version}}.tar.gz
expected-sha256: 42b71559c014c510412e94263404607e1bedbb4760f3688e35d1acc721cfc33a

- name: Configure and build
runs: |
cargo build --release --locked -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/meilisearch ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: meilisearch

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions ntpd-rs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: ntpd-rs
version: 0.3.6
epoch: 0
epoch: 1
description: "An NTP implementation in Rust."
copyright:
- license: MIT
Expand All @@ -23,11 +23,9 @@ pipeline:
tag: v${{package.version}}
expected-commit: 1fe2900096fd44cb275e0e901b18358082d47706

- name: Configure and build
runs: |
cargo build --release -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/ntp-daemon ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: ntp-daemon

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions pgcat.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: pgcat
version: 1.1.1
epoch: 0
epoch: 1
description: "PostgreSQL pooler with sharding, load balancing and failover support."
copyright:
- license: MIT
Expand All @@ -23,11 +23,9 @@ pipeline:
tag: v${{package.version}}
expected-commit: 1f2c6507f7fb5461df1a599c0b380aa114597bb5

- name: Configure and build
runs: |
cargo build --release -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/pgcat ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: pgcat

- uses: strip

Expand Down
30 changes: 30 additions & 0 deletions pipelines/rust/cargo-build.yaml
Copy link
Member

@joshrwolf joshrwolf Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a rust expert, but should we split this into cargo/fetch and cargo/build (with --offline or --locked) as the default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would like to split it, so that we can fetch in a prepare phase, and build in a later phase. This allows us to make the build process more hermetic in the future.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build a release binary using cargo build

needs:
packages:
- rust
- busybox
- ca-certificates-bundle

inputs:
target:
description: |
The name of the binary to build

subpackage:
description: |
Indicates that the build will write to a subpackage target folder
default: "false"

pipeline:
- runs: |
cargo build --release -vv

if [ "${{inputs.subpackage}}" == "true" ]; then
Copy link
Contributor

@kaniini kaniini Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have a pipeline node which defines a value. Something like:

pipeline:
  - set:
      target: ${{targets.destdir}}
  - if: ${{inputs.subpackage}} == 'true'
    set:
      target: ${{targets.subpkgdir}}
  - runs: |
       mkdir -p ${{vars.target}}
       mv target/release/${{inputs.target}} ${{vars.target}}

But I also wonder if it would be helpful to have a context-specific ${{targets.foo}} which evaluates to the correct location based on package vs. subpackage. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and implemented this in chainguard-dev/melange#622.

DEST_DIR="${{targets.subpkgdir}}"/usr/bin/
else
DEST_DIR="${{targets.destdir}}"/usr/bin/
fi

mkdir -p ${DEST_DIR}
mv target/release/${{inputs.target}} ${DEST_DIR}
10 changes: 4 additions & 6 deletions pixi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: pixi
version: 0.1.0
epoch: 0
epoch: 1
description: "Package management made easy"
copyright:
- license: BSD-3-Clause
Expand All @@ -23,11 +23,9 @@ pipeline:
expected-commit: 6fcd570094b0141ce9b3af10e52cee25aa28a6ff
tag: v${{package.version}}

- name: Configure and build
runs: |
cargo build --release
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/pixi ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: pixi

- uses: strip

Expand Down
15 changes: 5 additions & 10 deletions pulumi-watch.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: pulumi-watch
version: 0.1.5
epoch: 0
epoch: 1
description: Supports the functionality of the pulumi watch command
copyright:
- license: Apache-2.0
Expand All @@ -21,17 +21,12 @@ pipeline:
with:
repository: https://github.com/pulumi/watchutil-rs.git
tag: v${{package.version}}
destination: ${{package.name}}
expected-commit: bae2913e89662fbd0bf3264cb2985ea6b6c73c59

- working-directory: ${{package.name}}
pipeline:
- runs: |
set -x
cargo build --release -vv
mkdir -p "${{targets.destdir}}/usr/bin/"
mv target/release/pulumi-watch "${{targets.destdir}}/usr/bin/"
- uses: strip
- uses: rust/cargo-build
with:
target: pulumi-watch
- uses: strip

update:
enabled: true
Expand Down
9 changes: 4 additions & 5 deletions ruff.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: ruff
version: 0.0.285
epoch: 0
epoch: 1
description: An extremely fast Python linter, written in Rust.
copyright:
- license: MIT
Expand All @@ -21,10 +21,9 @@ pipeline:
tag: v${{package.version}}
expected-commit: 5892c691ea6389dcf53b2212bae7a3acd61ca15f

- runs: |
cargo build --release
mkdir -p ${{targets.destdir}}/usr/bin
mv target/release/ruff ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: ruff

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions wasm-tools.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: wasm-tools
version: 1.0.39
epoch: 0
epoch: 1
description: "Low level tooling for WebAssembly in Rust"
copyright:
- license: Apache-2.0
Expand All @@ -23,11 +23,9 @@ pipeline:
tag: wasm-tools-${{package.version}}
expected-commit: 2e63788ad535724e49a0da036281d9663b6d5294

- name: Configure and build
runs: |
cargo build --release -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/wasm-tools ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: wasm-tools

- uses: strip

Expand Down
10 changes: 4 additions & 6 deletions wit-bindgen.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: wit-bindgen
version: 0.10.0
epoch: 0
epoch: 1
description: "A language binding generator for WebAssembly interface types"
copyright:
- license: Apache-2.0
Expand All @@ -23,11 +23,9 @@ pipeline:
tag: wit-bindgen-cli-${{package.version}}
expected-commit: e32a150f876c291784d9cead97c58fac97cf216c

- name: Configure and build
runs: |
cargo build --release -vv
mkdir -p ${{targets.destdir}}/usr/bin/
mv target/release/wit-bindgen ${{targets.destdir}}/usr/bin/
- uses: rust/cargo-build
with:
target: wit-bindgen

- uses: strip

Expand Down