Skip to content

Commit

Permalink
Upgrade libcnb.rs to 0.15.0 (#143)
Browse files Browse the repository at this point in the history
* Upgrade `libcnb.rs` to `0.15.0`

The following general improvements were added for all commands:
- Added `Display` implementations for errors shared by several commands (i.e.; `FindReleasableBuildpacksError`, `SetActionOutputError`, `GetWorkingDirectoryError`, `ReadBuildpackDescriptor`)

### `generate_buildpack_matrix`

This command has been updated to remove hardcoded target output directories and instead accept a package directory (`--package-dir`). The other (optional) arguments are to line up with the arguments used by `cargo libcnb package` with sensible defaults.

The `_buildpacks_release.yml` workflow has also been updated to pass through the `--package-dir` argument which is set as the default value `./packaged`.

### `generate_changelog`

Slight modifications to support `libcnb` changes and refactorings detailed above.

### `prepare_release`

Slight modifications to support `libcnb` changes and refactorings detailed above.

### `update_builder`

Slight modifications to support `libcnb` changes and refactorings detailed above.

* pass --package-dir to libcnb package command

* rename directory args package-dir and workspace-dir

* switching get workspace dir helper to resolve path

* Replaced error `Display` impls with `thiserror`

* Refactor resolve functions

* Refactor resolve functions

* Use `map_or`

* Apply suggestions from code review

* Remove --release arg

Since:
- it was unused
- the implementation had a bug
- this tooling focuses on publishing release builds, so we don't really
  need to support non-release builds (and can always add them later
  if really needed)

* Remove --working-dir arg

Since it's unused.

The variable names were normalised back to `current_dir`, to
make its value clearer, and also since it reduces the size of the
overall PR (which contained a number of renames to `working_dir`).

* Fix lint error

---------

Co-authored-by: Ed Morley <[email protected]>
  • Loading branch information
colincasey and edmorley authored Oct 11, 2023
1 parent 2b6cc61 commit f581371
Show file tree
Hide file tree
Showing 16 changed files with 491 additions and 602 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/_buildpacks-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ defaults:

env:
CARGO_TERM_COLOR: always
PACKAGE_DIR: ./packaged

jobs:
compile:
Expand Down Expand Up @@ -101,11 +102,11 @@ jobs:

- name: Package buildpacks
id: libcnb-package
run: cargo libcnb package --release
run: cargo libcnb package --release --package-dir ${{ env.PACKAGE_DIR }}

- name: Generate buildpack matrix
id: generate-buildpack-matrix
run: actions generate-buildpack-matrix
run: actions generate-buildpack-matrix --package-dir ${{ env.PACKAGE_DIR }}

- name: Generate changelog
id: generate-changelog
Expand Down Expand Up @@ -153,7 +154,7 @@ jobs:
uses: actions/cache/save@v3
with:
key: ${{ github.run_id }}-compiled-buildpacks
path: target/buildpack
path: ${{ env.PACKAGE_DIR }}

publish-docker:
name: Publish → Docker - ${{ matrix.buildpack_id }}
Expand All @@ -169,7 +170,7 @@ jobs:
with:
fail-on-cache-miss: true
key: ${{ github.run_id }}-compiled-buildpacks
path: target/buildpack
path: ${{ env.PACKAGE_DIR }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

Expand Down Expand Up @@ -207,7 +208,7 @@ jobs:
with:
fail-on-cache-miss: true
key: ${{ github.run_id }}-compiled-buildpacks
path: target/buildpack
path: ${{ env.PACKAGE_DIR }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1

Expand Down
Loading

0 comments on commit f581371

Please sign in to comment.