Skip to content

Commit

Permalink
ci: add git cliff to generate changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Mar 3, 2024
1 parent d618203 commit 69d5de9
Show file tree
Hide file tree
Showing 12 changed files with 330 additions and 37 deletions.
72 changes: 50 additions & 22 deletions .github/workflows/build.yml
@@ -1,12 +1,14 @@
name: Build
on:
workflow_dispatch:
release:
types:
- published
# push:
push:
tags:
- "v*.*.*"
# branches:
# - main
# release:
# types:
# - published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -47,13 +49,13 @@ jobs:
name: nanopub_aarch64_linux_gnu
path: target/aarch64-unknown-linux-gnu/release/nanopub-cli

- if: github.event_name == 'release'
- if: startsWith(github.ref, 'refs/tags/')
run: |
mv target/release/nanopub-cli nanopub_x86_64_linux_gnu
mv target/aarch64-unknown-linux-gnu/release/nanopub-cli nanopub_aarch64_linux_gnu
- uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
nanopub_x86_64_linux_gnu
Expand Down Expand Up @@ -92,13 +94,13 @@ jobs:
name: nanopub_aarch64_apple
path: target/aarch64-apple-darwin/release/nanopub-cli

- if: github.event_name == 'release'
- if: startsWith(github.ref, 'refs/tags/')
run: |
mv target/release/nanopub-cli nanopub_x86_64_apple
mv target/aarch64-apple-darwin/release/nanopub-cli nanopub_aarch64_apple
- uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
nanopub_x86_64_apple
Expand All @@ -123,12 +125,12 @@ jobs:
name: nanopub_x86_64_windows_msvc
path: target/release/nanopub-cli.exe

- if: github.event_name == 'release'
- if: startsWith(github.ref, 'refs/tags/')
run: |
mv target/release/nanopub-cli.exe nanopub_x86_64_windows_msvc.exe
- uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
nanopub_x86_64_windows_msvc.exe
Expand All @@ -148,10 +150,10 @@ jobs:
- uses: docker/setup-qemu-action@v3
with:
platforms: linux/${{ matrix.architecture }}
if: github.event_name == 'release' && matrix.architecture != 'x86_64'
if: startsWith(github.ref, 'refs/tags/') && matrix.architecture != 'x86_64'
- run: sed 's/%arch%/${{ matrix.architecture }}/g' .github/workflows/manylinux_build.sh | sed 's/%for_each_version%/${{ github.event_name == 'release' || '' }}/g' > .github/workflows/manylinux_build_script.sh
- run: docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/manylinux2014_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
if: github.event_name == 'release' || matrix.architecture == 'x86_64'
if: startsWith(github.ref, 'refs/tags/') || matrix.architecture == 'x86_64'
- uses: actions/upload-artifact@v4
with:
name: nanopub_wheel_${{ matrix.architecture }}_linux
Expand All @@ -161,7 +163,7 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: target/wheels
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')


wheel_linux_musl:
Expand All @@ -180,10 +182,10 @@ jobs:
- uses: docker/setup-qemu-action@v3
with:
platforms: linux/${{ matrix.architecture }}
if: github.event_name == 'release' && matrix.architecture != 'x86_64'
if: startsWith(github.ref, 'refs/tags/') && matrix.architecture != 'x86_64'
- run: sed 's/%arch%/${{ matrix.architecture }}/g' .github/workflows/musllinux_build.sh | sed 's/%for_each_version%/${{ github.event_name == 'release' || '' }}/g' > .github/workflows/musllinux_build_script.sh
- run: docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/musllinux_1_1_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/musllinux_build_script.sh
if: github.event_name == 'release' || matrix.architecture == 'x86_64'
if: startsWith(github.ref, 'refs/tags/') || matrix.architecture == 'x86_64'
- uses: actions/upload-artifact@v4
with:
name: nanopub_wheel_${{ matrix.architecture }}_linux_musl
Expand All @@ -194,7 +196,7 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: target/wheels
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')


wheel_mac:
Expand All @@ -221,9 +223,9 @@ jobs:
- run: rm -r target/wheels
- run: maturin build --release --target universal2-apple-darwin -m python/Cargo.toml
- run: maturin build --release -m python/Cargo.toml
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')
- run: maturin build --release --target aarch64-apple-darwin -m python/Cargo.toml
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')
- uses: actions/upload-artifact@v4
with:
name: nanopub_wheel_universal2_mac
Expand All @@ -232,7 +234,7 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')


wheel_windows:
Expand Down Expand Up @@ -264,7 +266,7 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')


npm_tarball:
Expand Down Expand Up @@ -302,11 +304,11 @@ jobs:
working-directory: ./js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')

publish_crates:
name: 📦️ Publish crates to crates.io
if: github.event_name == 'release'
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -316,3 +318,29 @@ jobs:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- run: cargo publish
working-directory: ./lib

generate-changelog:
name: 🏔️ Generate changelog for GitHub release
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@main
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md

- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGES.md
if: startsWith(github.ref, 'refs/tags/')
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -53,7 +53,7 @@ jobs:
python-version: 3.12
- run: |
rustup update
venv .venv
python -m venv .venv
./scripts/test-python.sh
cov:
Expand Down
158 changes: 158 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,158 @@
# 📜 Changelog

All notable changes to this project will be documented in this file.

## [0.0.18](https://github.com/vemonet/nanopub-rs/compare/v0.0.17..0.0.18) - 2024-03-03

### ⚙️ Continuous Integration

- Fix test workflow, add cargo deny - ([a418526](https://github.com/vemonet/nanopub-rs/commit/a4185260a111e5e4b5d2815115da0d5c82df506a))

### 🐛 Bug Fixes

- Fix handling of published URI - ([09ea329](https://github.com/vemonet/nanopub-rs/commit/09ea3294e2459882c72c7d7535cd359ad0c1c401))

## [0.0.17](https://github.com/vemonet/nanopub-rs/compare/v0.0.16..v0.0.17) - 2024-01-30

### 🐛 Bug Fixes

- Fix issue with keypair in demo - ([0f6d0bc](https://github.com/vemonet/nanopub-rs/commit/0f6d0bc92ac9e84faa1336e06a5720d750a96c9b))
- Fix docs - ([b77cbe4](https://github.com/vemonet/nanopub-rs/commit/b77cbe4b898e965d221e9c566b1297793af29ef8))
- Fix rsa crate version - ([62cabd2](https://github.com/vemonet/nanopub-rs/commit/62cabd2ce681a1cbc1f2daa9ce09edcbc331ba84))
- Fix nanopub java ddl in workflow - ([9d7568a](https://github.com/vemonet/nanopub-rs/commit/9d7568af1ddf645f28ea6b9b361ccf01a4fe68e4))

## [0.0.16](https://github.com/vemonet/nanopub-rs/compare/v0.0.15..v0.0.16) - 2023-12-01

### 🐛 Bug Fixes

- Fix docs examples - ([08150af](https://github.com/vemonet/nanopub-rs/commit/08150af5ad7d26e61b7b5c70aa15a229ac76a6e6))
- Fix print - ([898b41d](https://github.com/vemonet/nanopub-rs/commit/898b41dd68334e879b85ab7dfe6bd9f759301b6a))
- Fix docs - ([f87a372](https://github.com/vemonet/nanopub-rs/commit/f87a372638e0337dd0fcdf4a0ca29dff1893231a))

## [0.0.15](https://github.com/vemonet/nanopub-rs/compare/v0.0.14..v0.0.15) - 2023-11-29

### 🐛 Bug Fixes

- Fix orcid init - ([8c72842](https://github.com/vemonet/nanopub-rs/commit/8c72842f03ae06f3fde2914184e99f2983fefcda))
- Fix main np server URL - ([229cde6](https://github.com/vemonet/nanopub-rs/commit/229cde6a751c887bfa411070ff4bcd7b894e00a9))
- Fix tests - ([e2b2866](https://github.com/vemonet/nanopub-rs/commit/e2b2866ea16f49ff6b1109f420070e00e75c49f5))

## [0.0.14](https://github.com/vemonet/nanopub-rs/compare/v0.0.13..v0.0.14) - 2023-11-29

### 🐛 Bug Fixes

- Fix tests - ([6c2feb8](https://github.com/vemonet/nanopub-rs/commit/6c2feb8818bb8db1edc5da80d01540011576f8b2))

## [0.0.13](https://github.com/vemonet/nanopub-rs/compare/v0.0.12..v0.0.13) - 2023-11-27

## [0.0.12](https://github.com/vemonet/nanopub-rs/compare/v0.0.11..v0.0.12) - 2023-11-27

### 🐛 Bug Fixes

- Fix demo example - ([021607c](https://github.com/vemonet/nanopub-rs/commit/021607c784dcd573570dcee6f3d8ad967be11bfd))
- Fix KeyPair import in demo - ([0e48f56](https://github.com/vemonet/nanopub-rs/commit/0e48f564268681a71889014cfb5da86a655a4864))
- Fix wasm init for pub intro - ([2501c4b](https://github.com/vemonet/nanopub-rs/commit/2501c4b0dcb45bf005c3654dc97199427ac81d62))
- Fix demo intro pub - ([7a8b177](https://github.com/vemonet/nanopub-rs/commit/7a8b177b4631e7b3c32668a38edd65b0b908bd9c))

## [0.0.11](https://github.com/vemonet/nanopub-rs/compare/v0.0.10..v0.0.11) - 2023-11-27

### 🐛 Bug Fixes

- Fix demo - ([f933d78](https://github.com/vemonet/nanopub-rs/commit/f933d780e34ed3fbcdc83096f84d869770f84bef))

## [0.0.10](https://github.com/vemonet/nanopub-rs/compare/v0.0.9..v0.0.10) - 2023-11-24

### 🐛 Bug Fixes

- Fix workflow upload - ([3df9d75](https://github.com/vemonet/nanopub-rs/commit/3df9d759c832f36cabea02dadfb03710e96e5d05))
- Fix docs - ([e7b6855](https://github.com/vemonet/nanopub-rs/commit/e7b6855bf887e4a74539ae58e214b537903f332d))
- Fix - ([5ab51c1](https://github.com/vemonet/nanopub-rs/commit/5ab51c1d2637ee96f38913ed0d3b67119937fa48))

## [0.0.9](https://github.com/vemonet/nanopub-rs/compare/v0.0.8..v0.0.9) - 2023-11-21

## [0.0.8](https://github.com/vemonet/nanopub-rs/compare/v0.0.7..v0.0.8) - 2023-11-21

### 🐛 Bug Fixes

- Fix binary install script - ([a07b07a](https://github.com/vemonet/nanopub-rs/commit/a07b07a04580ff5b64b9726a188e6ce33abb18d1))
- Fix dep - ([c9f9db0](https://github.com/vemonet/nanopub-rs/commit/c9f9db05dbe38f40b5cce1d538f51450cf24e124))
- Fix dep - ([a112208](https://github.com/vemonet/nanopub-rs/commit/a11220875c314dc13055f44fed94ee5901792e22))

## [0.0.7](https://github.com/vemonet/nanopub-rs/compare/v0.0.6..v0.0.7) - 2023-11-20

### 🐛 Bug Fixes

- Fix js pkg license - ([fc6e4c0](https://github.com/vemonet/nanopub-rs/commit/fc6e4c0977788d4d69870049d1fa8e0429486d7e))
- Fix js docs - ([2bcf5f5](https://github.com/vemonet/nanopub-rs/commit/2bcf5f54525e6788df445637cd54f68c1e15ce4a))

## [0.0.6](https://github.com/vemonet/nanopub-rs/compare/v0.0.5..v0.0.6) - 2023-11-20

### 🐛 Bug Fixes

- Fix npm publish bump 0.0.6 - ([3d3a0e5](https://github.com/vemonet/nanopub-rs/commit/3d3a0e59cae8b91f374adfa8fd1999fcf01cd8f8))

## [0.0.5](https://github.com/vemonet/nanopub-rs/compare/v0.0.4..v0.0.5) - 2023-11-20

### 🐛 Bug Fixes

- Fix npm publish bump 0.0.5 - ([bcccf74](https://github.com/vemonet/nanopub-rs/commit/bcccf74e8cae1805ddb3982f2700022c7a31afee))

## [0.0.4](https://github.com/vemonet/nanopub-rs/compare/v0.0.3..v0.0.4) - 2023-11-20

### 🐛 Bug Fixes

- Fix codecov workflow - ([54e20eb](https://github.com/vemonet/nanopub-rs/commit/54e20eb70d365f10dcad569c3a34558a5d36fdd0))

## [0.0.3](https://github.com/vemonet/nanopub-rs/compare/v0.0.2..v0.0.3) - 2023-11-20

### 🐛 Bug Fixes

- Fix bump script and bump to 0.0.3 - ([69ee8fa](https://github.com/vemonet/nanopub-rs/commit/69ee8faa0d741b99abee18b07ca5a2d7c203f5ba))

## [0.0.2](https://github.com/vemonet/nanopub-rs/compare/v0.0.1..v0.0.2) - 2023-11-20

### 🐛 Bug Fixes

- Fix issues with pkg versions - ([6822464](https://github.com/vemonet/nanopub-rs/commit/68224641ada479575ee4d9830d31e88e1aa90f5f))

## [0.0.1](https://github.com/vemonet/nanopub-rs/tree/v0.0.1) - 2023-11-20

### 🐛 Bug Fixes

- Fix docs - ([8e53b47](https://github.com/vemonet/nanopub-rs/commit/8e53b471fef87d1991ac3358b9e470ac34151ae6))
- Fix doc workflow - ([5fac322](https://github.com/vemonet/nanopub-rs/commit/5fac322f5f0bbd7b81973aa2871ba7a07dd68aea))
- Fix error msg js - ([2b244c4](https://github.com/vemonet/nanopub-rs/commit/2b244c4acc39b22c6dccea9aad37622c95dc8242))
- Fix ref - ([05fa3b9](https://github.com/vemonet/nanopub-rs/commit/05fa3b956586251bc96e0b704e20b5863a04a262))
- Fix ref - ([9522b91](https://github.com/vemonet/nanopub-rs/commit/9522b913eaee1159288312557895a6df80508893))
- Fix wheel build - ([cf88924](https://github.com/vemonet/nanopub-rs/commit/cf889246563419f60b134d8d7b83a9885f334c87))
- Fix python dev deps - ([10bb8ee](https://github.com/vemonet/nanopub-rs/commit/10bb8ee242097e0c829352089fa627e23debfded))
- Fix python dev deps - ([7b168f9](https://github.com/vemonet/nanopub-rs/commit/7b168f9d0a086d559a272df138e6ecef894b4a97))
- Fix workflow - ([282d923](https://github.com/vemonet/nanopub-rs/commit/282d923500016cf8559aeee5c89b7c975996a4e6))
- Fix wheel build - ([dd9d97b](https://github.com/vemonet/nanopub-rs/commit/dd9d97ba32d3eabd4059e3901632bfeb4e9773e3))
- Fix conf - ([53b40ca](https://github.com/vemonet/nanopub-rs/commit/53b40ca304b8f7eb16e0fa92de345d6a8438d55e))
- Fix workflow - ([4cfaab3](https://github.com/vemonet/nanopub-rs/commit/4cfaab304d574c9524fe0f31b81082b837670364))
- Fix workflow - ([78af5b2](https://github.com/vemonet/nanopub-rs/commit/78af5b2a105cd684832e3f7e8998a4f51491a581))
- Fix reqwest for wasm - ([d2b7400](https://github.com/vemonet/nanopub-rs/commit/d2b74008df3e16c26a86a1c6beca71f597c267b7))
- Fix wasm bindgen future import - ([3c214d9](https://github.com/vemonet/nanopub-rs/commit/3c214d97867fc617a8548a65078a6d7031f6ed29))
- Fix wasm - ([2feca44](https://github.com/vemonet/nanopub-rs/commit/2feca44fa8e8554948b22be78bbc014f9fa426d8))
- Fix profile pointer - ([dfba31c](https://github.com/vemonet/nanopub-rs/commit/dfba31cd883a9c75d18669741678d3a2ba75033d))
- Fix workflow - ([872eca6](https://github.com/vemonet/nanopub-rs/commit/872eca6ee25879f2fe6e569d66316ec8214e2a4f))
- Fix bench - ([3190c74](https://github.com/vemonet/nanopub-rs/commit/3190c74e2089011bb1e9b51945fd47fba452441d))
- Fix export benchmark md - ([09c99e1](https://github.com/vemonet/nanopub-rs/commit/09c99e115774ac1b5f5bd3f6e6ab51fc7889d688))
- Fix test - ([8473e8d](https://github.com/vemonet/nanopub-rs/commit/8473e8d08fb6817bd1b37a597b874b98a1741cc1))
- Fix install tarpaulin - ([b8bad05](https://github.com/vemonet/nanopub-rs/commit/b8bad05dd47b5807a01fe0e5a12d568476b6c6b9))
- Fix wasm - ([cc0e45c](https://github.com/vemonet/nanopub-rs/commit/cc0e45ca518325fd3a41a21c1b60cf74361b44b1))
- Fix wasm - ([8ea54d1](https://github.com/vemonet/nanopub-rs/commit/8ea54d1660c15b5b5e458598434c0dcdec107787))
- Fix wasm - ([4e375e4](https://github.com/vemonet/nanopub-rs/commit/4e375e47768607d165d494a39c9a4174d37d6940))
- Fix sophia version - ([d623ec7](https://github.com/vemonet/nanopub-rs/commit/d623ec7ff5b37fdeef140823cad7a40a6f6c7ac3))
- Fix version and delete lib/README.md - ([e4c0835](https://github.com/vemonet/nanopub-rs/commit/e4c08355ebcbee67e796434e798c3ece0c0ec146))
- Fix docs outside pkg - ([21ef352](https://github.com/vemonet/nanopub-rs/commit/21ef3521c71a75ab28c556db080a7c75639bba2e))

### 📚 Documentation

- Doc - ([9d98002](https://github.com/vemonet/nanopub-rs/commit/9d980024c0fad3179bd7a719115283274c216c6c))
- Docs - ([6ea7b08](https://github.com/vemonet/nanopub-rs/commit/6ea7b08337d8e344b0cc5a12ba4090ab3c77cb98))
- Docs - ([c95bcd3](https://github.com/vemonet/nanopub-rs/commit/c95bcd381b6929a60bd99acfde361d275d3444e1))
- Docs - ([8bd0e63](https://github.com/vemonet/nanopub-rs/commit/8bd0e63fbd238ee4267c10d90780eac54f7041eb))

<!-- generated by git-cliff -->
4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -8,7 +8,7 @@ members = [
]

[workspace.package]
# version = "0.0.1"
version = "0.0.18"
authors = ["Vincent Emonet <vincent.emonet@gmail.com>"]
edition = "2021"
repository = "https://github.com/vemonet/nanopub-rs"
Expand All @@ -21,4 +21,4 @@ categories = ["science", "encoding", "database-interface", "cryptography"]
# [workspace.dependencies]

[profile.release]
lto = true
lto = true
2 changes: 1 addition & 1 deletion cli/Cargo.toml
@@ -1,10 +1,10 @@
[package]
name = "nanopub-cli"
version = "0.0.18"
description = """
A cross-platform CLI tool written in Rust to sign Nanopublications.
"""
repository = "https://github.com/vemonet/nanopub-rs/tree/main/cli"
version.workspace = true
authors.workspace = true
edition.workspace = true
readme.workspace = true
Expand Down

0 comments on commit 69d5de9

Please sign in to comment.