Skip to content

Commit

Permalink
chore: Add release workflow; correct default user agent header (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs authored Aug 23, 2024
1 parent 893af8c commit 87f36ec
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 18 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
changelog:
name: Create release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md
GITHUB_REPO: ${{ github.repository }}
22 changes: 18 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
target
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
.envrc
default.nix
shell.nix

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Misc
*.swp
.idea
.DS_Store
21 changes: 9 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
[package]
name = "docker-registry"
rust-version = "1.70.0"
version = "0.5.1-alpha.0"
authors = ["Bryant Biggs <[email protected]>", "Luca Bruno <[email protected]>", "Stefan Junker <[email protected]>"]
version = "0.6.0"
authors = [
"Luca Bruno <[email protected]>",
"Stefan Junker <[email protected]>",
"Bryant Biggs <[email protected]>",
]
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/docker-registry"
repository = "https://github.com/clowdhaus/docker-registry-http-api-v2"
repository = "https://github.com/clowdhaus/docker-registry"
description = "A pure-Rust asynchronous library for Docker Registry HTTP API v2"
keywords = [
"docker",
Expand All @@ -14,18 +18,11 @@ keywords = [
]
exclude = [
".gitignore",
"certificates",
"tests",
]
edition = "2021"

[package.metadata.release]
disable-publish = true
disable-push = true
post-release-commit-message = "cargo: development version bump"
pre-release-commit-message = "cargo: docker-registry release {{version}}"
sign-commit = true
sign-tag = true
tag-message = "docker-registry v{{version}}"

[dependencies]
base64 = "0.22"
futures = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Docker Registry HTTP API v2
# Docker Registry

A pure-Rust asynchronous library for the Docker Registry HTTP API v2.

Expand Down
55 changes: 55 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Configuration file for [`git-cliff`](https://github.com/orhun/git-cliff)
# See https://git-cliff.org/docs/configuration

[remote.github]
owner = "clowdhaus"
repo = "docker-registry"

[changelog]
header = """
# Changelog
All notable changes to this project will be documented in this file.
"""
# https://keats.github.io/tera/docs/#introduction
body = """\
{% set gh_link = "https://github.com/" ~ remote.github.owner ~ "/" ~ remote.github.repo %}\
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}]({{ gh_link }}/releases/tag/v{{ version | trim_start_matches(pat="v") }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [Unreleased]({{ gh_link }}/compare/{{ previous.version }}...HEAD)
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | title }}
{% for commit in commits %}
- {% if commit.scope %}[{{ commit.scope }}] {% endif %}{{ commit.message | upper_first | split(pat="\\n") | first }}\
{% endfor %}
{% endfor %}\n
"""
trim = true
footer = """
"""

[git]
conventional_commits = true
filter_unconventional = false
commit_preprocessors = []
commit_parsers = [
{ message = "^[Ff]eat", group = "Features" },
{ message = "^[Ff]ix", group = "Bug Fixes" },
{ message = "^[Dd]oc", group = "Documentation" },
{ message = ".*\\b([Dd]eps|[Dd]ependencies|[Bb]ump)\\b", group = "Dependencies" },
{ message = "^[Pp]erf", group = "Performance" },
{ message = "^[Rr]efactor", group = "Refactor" },
{ message = ".*\\b([Ss]tyle|[Ff]mt|[Ff]ormat)\\b", group = "Styling" },
{ message = "^[Tt]est", group = "Testing" },
{ message = "^[Cc]hore", group = "Miscellaneous Tasks" },

{ message = ".*", group = "Other" },
]
protect_breaking_commits = false
filter_commits = false
tag_pattern = "v[0-9]*"
skip_tags = "beta|alpha"
ignore_tags = "rc"
sort_commits = "newest"
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use base64::prelude::*;
use errors::{Error, Result};

/// Default User-Agent client identity.
pub static USER_AGENT: &str = "camallo-docker_registry/0.0";
pub static USER_AGENT: &str = "clowdhaus/docker-registry/0.0";

/// Get registry credentials from a JSON config reader.
///
Expand Down

0 comments on commit 87f36ec

Please sign in to comment.