Skip to content

Commit

Permalink
Setup publish CI (#26)
Browse files Browse the repository at this point in the history
* Setup publish CI

* Add missing newline

* Don't filter unconventional commits
  • Loading branch information
jedel1043 authored Feb 25, 2024
1 parent a32940f commit e3b1191
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .github/release.yml

changelog:
exclude:
authors:
- dependabot
categories:
- title: Enhancements
labels:
- C-enhancement
- title: Bug Fixes
labels:
- C-bug
- title: Documentation
labels:
- C-documentation
- title: Tests
labels:
- C-testing
- title: Other Changes
labels:
- '*'
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish Release

on:
release:
types: [published]

jobs:
publish:
name: Publish crate
runs-on: ubuntu-latest
timeout-minutes: 60
env:
RUSTFLAGS: -D warnings
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Package (dry-run)
run: cargo package
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
PATCH: ${{ github.run_number }}
shell: bash
run: |
git config --global user.email "runner@gha.local"
git config --global user.name "Github Action"
cargo publish
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
[package]
name = "temporal_rs" # Working name - TODO: Update name to decided.
name = "temporal_rs"
keywords = ["javascript", "js", "temporal", "calendar", "date", "time", "timezone"]
categories = ["date", "time", "calendars"]
readme = "./README.md"
description = "Temporal in Rust is an implementation of TC39 Temporal Builtin Proposal in Rust."
description = "Temporal in Rust is an implementation of the TC39 Temporal Builtin Proposal in Rust."
version = "0.0.1"
edition = "2021"
authors = ["boa-dev"]
license = "MIT"
repository = "https://github.com/boa-dev/temporal"
rust-version = "1.74"
exclude = [
"docs/*",
".github/*",
".gitignore",
"LICENSE*",
]

[dependencies]
tinystr = "0.7.4"
Expand Down
83 changes: 83 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

[remote.github]
owner = "boa-dev"
repo = "temporal"

[changelog]
body = """
## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
{% if commit.github.pr_title -%}
{%- set commit_message = commit.github.pr_title -%}
{%- else -%}
{%- set commit_message = commit.message -%}
{%- endif -%}
* {{ commit_message | split(pat="\n") | first | trim }}\
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%}
{% if commit.github.pr_number %} in \
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# postprocessors
postprocessors = []

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = false
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# 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
# regex for matching git tags
tag_pattern = "v[0-9].*"
# regex for skipping tags
skip_tags = "beta|alpha"
# regex for ignoring tags
ignore_tags = "rc"
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"

0 comments on commit e3b1191

Please sign in to comment.