Skip to content

Commit

Permalink
Release v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-delfino1995 committed Feb 5, 2023
1 parent bb3cdf2 commit 4cf4ff4
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 81 deletions.
15 changes: 9 additions & 6 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Cache

inputs:
rustc:
description: Rustc version hash
required: true
variant:
description: Variant to distinguish different caches
default: 'default'
Expand Down Expand Up @@ -32,20 +35,20 @@ runs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ inputs.rustc }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo
${{ runner.os }}-${{ inputs.rustc }}-cargo
- name: Restore compiled dependencies
id: compiled
if: inputs.compiled == 'restore'
uses: actions/cache/restore@v3
with:
path: target/
key: ${{ runner.os }}-cargo-${{ inputs.variant }}-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ inputs.rustc }}-cargo-${{ inputs.variant }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ inputs.variant }}
${{ runner.os }}-cargo-default
${{ runner.os }}-${{ inputs.rustc }}-cargo-${{ inputs.variant }}
${{ runner.os }}-${{ inputs.rustc }}-cargo-default
- name: Configure cleanup before cache save
if: inputs.compiled == 'save'
Expand All @@ -59,4 +62,4 @@ runs:
uses: actions/cache/save@v3
with:
path: target/
key: ${{ runner.os }}-cargo-${{ inputs.variant }}-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ inputs.rustc }}-cargo-${{ inputs.variant }}-${{ hashFiles('**/Cargo.lock') }}
24 changes: 12 additions & 12 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Configure cache
id: cache
uses: ./.github/actions/cache

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy, llvm-tools

- name: Configure cache
id: cache
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}

- name: Compile project
if: steps.cache.outputs.compiled != 'true'
uses: actions-rs/cargo@v1
Expand All @@ -30,20 +33,17 @@ jobs:

- name: Install coverage tool
if: steps.cache.outputs.index != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: grcov
shell: bash
run: which grcov || cargo install grcov

- name: Install cross compiler
if: steps.cache.outputs.index != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: cross
shell: bash
run: which cross || cargo install cross

- name: Save cache
if: steps.cache.outputs.compiled != 'true'
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
compiled: save
32 changes: 18 additions & 14 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Restore cache
id: cache
uses: ./.github/actions/cache
with:
variant: coverage
compiled: restore

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: llvm-tools

- name: Restore cache
id: cache
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
variant: coverage
compiled: restore

- name: Run tests
uses: actions-rs/cargo@v1
env:
Expand All @@ -45,10 +47,8 @@ jobs:

- name: Install coverage tool
if: steps.cache.outputs.index != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: grcov
shell: bash
run: which grcov || cargo install grcov

- name: Generate coverage report
shell: bash
Expand All @@ -66,6 +66,7 @@ jobs:
- name: Save cache
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
variant: coverage
compiled: save

Expand All @@ -77,17 +78,20 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Configure cache
uses: ./.github/actions/cache

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Configure cache
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
Expand Down
39 changes: 25 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Restore cache
uses: ./.github/actions/cache

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Restore cache
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}

- name: Run tests
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -121,37 +124,38 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Restore cache
id: cache
uses: ./.github/actions/cache
with:
variant: release
compiled: skip

- name: Install toolchain
id: toolchain
uses: actions-rs/toolchain@v1
with:
target: ${{ matrix.target }}
profile: minimal
toolchain: stable
override: true

- name: Configure cache
uses: ./.github/actions/cache
with:
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
compiled: skip

- name: Linux x86 cross compiler
if: startsWith(matrix.target, 'i686-unknown-linux-')
run: sudo apt install gcc-multilib

- name: ARM cross compiler
if: startsWith(matrix.target, 'aarch64-unknown-linux-') && steps.cache.outputs.index != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: cross
shell: bash
run: which cross || cargo install cross

- name: ARM gcc
if: startsWith(matrix.target, 'aarch64-unknown-linux-')
shell: bash
run: sudo apt install gcc-aarch64-linux-gnu

- name: Musl gcc
if: endsWith(matrix.target, '-musl')
shell: bash
run: sudo apt install musl musl-tools

- name: Run cross build
Expand All @@ -173,8 +177,15 @@ jobs:
cp ${{ matrix.bin }} ../../../${{ matrix.name }}
- name: Generate SHA-256
if: matrix.os != 'windows-latest'
shell: bash
run: shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256

- name: Generate SHA-256 on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: Get-FileHash ${{ matrix.name }} -Algorithm SHA256 | Out-File -FilePath ${{ matrix.name }}.sha256

- name: Publish
uses: softprops/action-gh-release@v1
with:
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.6.0] - 2023-02-05

### Added

Expand All @@ -15,7 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- no automatic input for `_.files`, now it gets it from the second parameter
- `_.files` in libsonnet have an optional second parameter to keep the old experience
- optional input parameter for `_.files` to keep the old experience
- optional input parameter for `_.include` for packages without input
- separate package crate into compiler and jsonnet crates

### Fixed
Expand All @@ -27,7 +28,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- package command was removed because its original purpose is now achieved with jsonnet bundler
- schema validation for `example.json` - you can compile with it as input to validate it


## [0.5.0] - 2022-07-01

### Added
Expand Down Expand Up @@ -115,7 +115,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- package description from `kcp.json`
- "extensibility" guarantees by forbidding non object paths to K8s objects

[Unreleased]: https://github.com/bruno-delfino1995/kct/compare/v0.5.0...HEAD
[0.6.0]: https://github.com/bruno-delfino1995/kct/compare/v0.6.0...v0.5.0
[0.5.0]: https://github.com/bruno-delfino1995/kct/compare/v0.5.0...v0.4.0
[0.4.0]: https://github.com/bruno-delfino1995/kct/compare/v0.4.0...v0.3.1
[0.3.1]: https://github.com/bruno-delfino1995/kct/compare/v0.3.1...v0.2.0
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
]

[workspace.package]
version = "0.5.0"
version = "0.6.0"
edition = "2021"
license = "MIT"
authors = ["Bruno Felipe Leal Delfino <bruno.delfino1995@gmail.com>"]
Expand All @@ -19,12 +19,12 @@ repository = "https://github.com/bruno-delfino1995/kct"
[workspace.dependencies]
anyhow = "1.0.68"
assert_matches = "1.5.0"
kct_compiler = { path = "./crates/kct_compiler", version = "=0.5.0"}
kct_helper = { path = "./crates/kct_helper", version = "=0.5.0"}
kct_jsonnet = { path = "./crates/kct_jsonnet", version = "=0.5.0"}
kct_kube = { path = "./crates/kct_kube", version = "=0.5.0"}
kct_package = { path = "./crates/kct_package", version = "=0.5.0"}
kct_testing = { path = "./crates/kct_testing", version = "=0.5.0"}
kct_compiler = { path = "./crates/kct_compiler", version = "=0.6.0"}
kct_helper = { path = "./crates/kct_helper", version = "=0.6.0"}
kct_jsonnet = { path = "./crates/kct_jsonnet", version = "=0.6.0"}
kct_kube = { path = "./crates/kct_kube", version = "=0.6.0"}
kct_package = { path = "./crates/kct_package", version = "=0.6.0"}
kct_testing = { path = "./crates/kct_testing", version = "=0.6.0"}
serde_json = "1.0.91"
serde_yaml = "0.8"
tera = "1.17.1"
Expand Down
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ release:
#!/usr/bin/env bash
set -euo pipefail
VERSION=$(gum input --placeholder "version")
cargo workspaces version --no-git-commit --exact --yes custom "$VERSION"
TAG="v${VERSION}"
git switch main
git commit -am "Release $TAG"
git tag -sm "Release $TAG" $TAG
git push -u origin HEAD
git push -u origin $TAG
git push origin HEAD
git push origin $TAG
Loading

0 comments on commit 4cf4ff4

Please sign in to comment.