chore(release): prepare 1.0.0 release
This commit is contained in:
22
.github/workflows/action.yml
vendored
22
.github/workflows/action.yml
vendored
@@ -28,21 +28,27 @@ jobs:
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Set up cachix
|
||||
uses: cachix/cachix-action@v17
|
||||
with:
|
||||
name: phundrak
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Format Check
|
||||
run: |
|
||||
nix develop --no-pure-eval --accept-flake-config --command just format-check
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just format-check
|
||||
|
||||
- name: Audit
|
||||
run: |
|
||||
nix develop --no-pure-eval --accept-flake-config --command just audit
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just audit
|
||||
|
||||
- name: Coverage
|
||||
run: |
|
||||
nix develop --no-pure-eval --accept-flake-config --command just coverage-ci
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just coverage-ci
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
nix develop --no-pure-eval --accept-flake-config --command just lint-report
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just lint-report
|
||||
|
||||
- name: Sonar analysis
|
||||
uses: SonarSource/sonarqube-scan-action@v6
|
||||
|
||||
105
.github/workflows/release.yml
vendored
Normal file
105
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Set up cachix
|
||||
uses: cachix/cachix-action@v17
|
||||
with:
|
||||
name: phundrak
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Run Checks
|
||||
run: nix develop --no-pure-eval --command just check-all
|
||||
|
||||
release:
|
||||
needs: checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.CI_TOKEN }}
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Set up cachix
|
||||
uses: cachix/cachix-action@v17
|
||||
with:
|
||||
name: phundrak
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Check for releasable commits
|
||||
id: releasable
|
||||
run: |
|
||||
COUNT=$(nix develop --no-pure-eval --command just cliff-count)
|
||||
echo "count=$COUNT" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Determine next version
|
||||
if: steps.releasable.outputs.count > 0
|
||||
id: next_version
|
||||
run: |
|
||||
CLIFF_NEXT_VERSION=$(nix develop --no-pure-eval --command just cliff-next-version)
|
||||
echo "version=$CLIFF_NEXT_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update changelog
|
||||
if: steps.releasable.outputs.count > 0
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just cliff-bump
|
||||
|
||||
- name: Create release commit
|
||||
if: steps.releasable.outputs.count > 0
|
||||
env:
|
||||
VERSION: ${{ steps.next_version.outputs.version }}
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just commit-release $VERSION
|
||||
|
||||
- name: Create version tag
|
||||
if: steps.releasable.outputs.count > 0
|
||||
env:
|
||||
VERSION: ${{ steps.next_version.outputs.version }}
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just create-release-tag $VERSION
|
||||
|
||||
- name: Build Linux release binaries
|
||||
if: steps.releasable.outputs.count > 0
|
||||
run: nix build
|
||||
|
||||
- name: Build Windows release binaries
|
||||
if: steps.releasable.outputs.count > 0
|
||||
run: nix build .#windows
|
||||
|
||||
- name: Publish on crates.io
|
||||
if: steps.releasable.outputs.count > 0
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: cargo publish
|
||||
|
||||
- name: Rebase develop onto main
|
||||
if: steps.releasable.outputs.count > 0
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just rebase-develop
|
||||
|
||||
- name: Bump to next dev version
|
||||
if: steps.releasable.outputs.count > 0
|
||||
env:
|
||||
VERSION: ${{ steps.next_version.outputs.version }}
|
||||
shell: bash -c "nix develop --no-pure-eval --accept-flake-config --command {0}"
|
||||
run: just update-develop-version $VERSION
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1650,7 +1650,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jj-cz"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0-dev"
|
||||
dependencies = [
|
||||
"assert_cmd",
|
||||
"assert_fs",
|
||||
|
||||
68
Cargo.toml
68
Cargo.toml
@@ -1,8 +1,9 @@
|
||||
[package]
|
||||
name = "jj-cz"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0-dev"
|
||||
description = "Conventional commits for Jujutsu"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
publish = true
|
||||
authors = ["Lucien Cartier-Tilet <lucien@phundrak.com>"]
|
||||
license = "MIT OR GPL-3.0-or-later"
|
||||
homepage = "https://labs.phundrak.com/phundrak/jj-cz"
|
||||
@@ -47,3 +48,66 @@ lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
||||
strip = true
|
||||
|
||||
[package.metadata.git-cliff.changelog]
|
||||
body = """
|
||||
{% if version %}\
|
||||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||
{% else %}\
|
||||
## [unreleased]
|
||||
{% endif %}\
|
||||
{% for group, commits in commits | group_by(attribute="group") %}
|
||||
### {{ group | striptags | trim | upper_first }}
|
||||
{% for commit in commits %}
|
||||
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
|
||||
{% if commit.breaking %}[**breaking**] {% endif %}\
|
||||
{{ commit.message | upper_first }}\
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
"""
|
||||
trim = true
|
||||
render_always = true
|
||||
postprocessors = [
|
||||
{ pattern = '<REPO>', replace = "https://labs.phundrak.com/phundrak/jj-cz" },
|
||||
]
|
||||
|
||||
[package.metadata.git-cliff.bump]
|
||||
features_always_bump_minor = true
|
||||
breaking_always_bump_major = true
|
||||
initial_tag = "1.0.0"
|
||||
|
||||
[package.metadata.git-cliff.git]
|
||||
conventional_commits = true
|
||||
filter_unconventional = true
|
||||
require_conventional = false
|
||||
split_commits = false
|
||||
commit_preprocessors = [
|
||||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
|
||||
{ pattern = '.*', replace_command = 'typos --write-changes -' },
|
||||
]
|
||||
protect_breaking_commits = false
|
||||
commit_parsers = [
|
||||
{ message = "^feat", group = "<!-- 0 -->Features" },
|
||||
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
|
||||
{ message = "^doc", group = "<!-- 3 -->Documentation" },
|
||||
{ message = "^perf", group = "<!-- 4 -->Performance" },
|
||||
{ message = "^refactor", group = "<!-- 2 -->Refactor" },
|
||||
{ message = "^style", group = "<!-- 5 -->Styling" },
|
||||
{ message = "^test", group = "<!-- 6 -->Testing" },
|
||||
{ message = "^chore\\(release\\):", skip = true },
|
||||
{ message = "^chore\\(deps.*\\)", skip = true },
|
||||
{ message = "^chore\\(pr\\)", skip = true },
|
||||
{ message = "^chore\\(pull\\)", skip = true },
|
||||
{ message = "^chore|^ci", group = "<!-- 7 -->Miscellaneous Tasks" },
|
||||
{ body = ".*security", group = "<!-- 8 -->Security" },
|
||||
{ message = "^revert", group = "<!-- 9 -->Revert" },
|
||||
{ message = ".*", group = "<!-- 10 -->Other" },
|
||||
]
|
||||
filter_commits = false
|
||||
fail_on_unmatched_commit = false
|
||||
link_parsers = []
|
||||
use_branch_tags = false
|
||||
topo_order = false
|
||||
topo_order_commits = true
|
||||
sort_commits = "oldest"
|
||||
recurse_submodules = false
|
||||
|
||||
71
cliff.toml
71
cliff.toml
@@ -1,71 +0,0 @@
|
||||
# configuration file for git-cliff
|
||||
# see https://github.com/orhun/git-cliff#configuration-file
|
||||
|
||||
[changelog]
|
||||
# changelog header
|
||||
header = """
|
||||
# Changelog\n
|
||||
All notable changes to this project will be documented in this file.\n
|
||||
"""
|
||||
# template for the changelog body
|
||||
# https://tera.netlify.app/docs/#introduction
|
||||
body = """
|
||||
{% if version %}\
|
||||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||
{% else %}\
|
||||
## [unreleased]
|
||||
{% endif %}\
|
||||
{% for group, commits in commits | group_by(attribute="group") %}
|
||||
### {{ group | upper_first }}
|
||||
{% for commit in commits %}
|
||||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
|
||||
{% endfor %}
|
||||
{% endfor %}\n
|
||||
"""
|
||||
# remove the leading and trailing whitespace from the template
|
||||
trim = true
|
||||
# changelog footer
|
||||
footer = """
|
||||
<!-- generated by git-cliff -->
|
||||
"""
|
||||
|
||||
[git]
|
||||
# parse the commits based on https://www.conventionalcommits.org
|
||||
conventional_commits = true
|
||||
# filter out the commits that are not conventional
|
||||
filter_unconventional = true
|
||||
# process each line of a commit as an individual commit
|
||||
split_commits = false
|
||||
# regex for preprocessing the commit messages
|
||||
commit_preprocessors = [
|
||||
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
|
||||
]
|
||||
# regex for parsing and grouping commits
|
||||
commit_parsers = [
|
||||
{ message = "^feat", group = "Features"},
|
||||
{ message = "^fix", group = "Bug Fixes"},
|
||||
{ message = "^doc", group = "Documentation"},
|
||||
{ message = "^perf", group = "Performance"},
|
||||
{ message = "^refactor", group = "Refactor"},
|
||||
{ message = "^style", group = "Styling"},
|
||||
{ message = "^test", group = "Testing"},
|
||||
{ message = "^chore\\(release\\): prepare for", skip = true},
|
||||
{ message = "^chore", group = "Miscellaneous Tasks"},
|
||||
{ body = ".*security", group = "Security"},
|
||||
]
|
||||
# protect breaking changes from being skipped due to matching a skipping commit_parser
|
||||
protect_breaking_commits = false
|
||||
# filter out the commits that are not matched by commit parsers
|
||||
filter_commits = false
|
||||
# glob pattern for matching git tags
|
||||
tag_pattern = "v[0-9]*"
|
||||
# regex for skipping tags
|
||||
skip_tags = "v0.1.0-beta.1"
|
||||
# regex for ignoring tags
|
||||
ignore_tags = ""
|
||||
# sort the tags topologically
|
||||
topo_order = false
|
||||
# sort the commits inside sections by oldest/newest order
|
||||
sort_commits = "oldest"
|
||||
# limit the number of commits included in the changelog.
|
||||
# limit_commits = 42
|
||||
39
justfile
39
justfile
@@ -30,6 +30,9 @@ lint-report:
|
||||
test:
|
||||
cargo test --features test-utils
|
||||
|
||||
fast-test:
|
||||
cargo nextest run --all --all-features
|
||||
|
||||
coverage:
|
||||
mkdir -p coverage
|
||||
cargo tarpaulin --config .tarpaulin.local.toml --features test-utils
|
||||
@@ -38,7 +41,41 @@ coverage-ci:
|
||||
mkdir -p coverage
|
||||
cargo tarpaulin --config .tarpaulin.ci.toml --features test-utils
|
||||
|
||||
check-all: format-check lint coverage audit
|
||||
check-all: format-check lint fast-test audit
|
||||
|
||||
cliff-count:
|
||||
git-cliff --unreleased | tail -n +3 | wc -l
|
||||
|
||||
cliff-next-version:
|
||||
git-cliff --bumped-version
|
||||
|
||||
cliff-bump:
|
||||
git-cliff --bump -o CHANGELOG.md
|
||||
|
||||
commit-release version:
|
||||
cargo set-version "{{version}}"
|
||||
git config user.name "CI Bot"
|
||||
git config user.email "ci@phundrak.com"
|
||||
git add Cargo.toml Cargo.lock CHANGELOG.md
|
||||
git commit -m "chore(release): release {{version}} [skip ci]"
|
||||
git push origin main
|
||||
|
||||
create-release-tag version:
|
||||
git tag "{{version}}"
|
||||
git push origin "{{version}}"
|
||||
|
||||
rebase-develop:
|
||||
git fetch origin
|
||||
git checkout develop
|
||||
git rebase origin/main
|
||||
|
||||
update-develop-version version:
|
||||
#!/usr/bin/env bash
|
||||
NEXT_DEV=$(echo "{{version}}" | awk -F. '{print $1"."$2"."$3+1}')"-dev"
|
||||
cargo set-version "$NEXT_DEV"
|
||||
git add Cargo.toml Cargo.lock
|
||||
git commit -m "chore(release): bump version to $NEXT_DEV [skip ci]"
|
||||
git push origin develop
|
||||
|
||||
## Local Variables:
|
||||
## mode: makefile
|
||||
|
||||
@@ -19,9 +19,12 @@ inputs.devenv.lib.mkShell {
|
||||
})
|
||||
bacon
|
||||
cargo-deny
|
||||
cargo-edit
|
||||
cargo-nextest
|
||||
cargo-tarpaulin
|
||||
git-cliff
|
||||
just
|
||||
typos
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
@@ -81,7 +81,7 @@ impl ConventionalCommit {
|
||||
+ self.description.len()
|
||||
}
|
||||
|
||||
/// Format the complete commit messsage
|
||||
/// Format the complete commit message
|
||||
///
|
||||
/// Returns `type(scope): description` if scope is non-empty, or
|
||||
/// `type: description` if scope is empty
|
||||
|
||||
Reference in New Issue
Block a user