Template
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02f9bbd817 | ||
|
|
d2400ee8bf | ||
|
|
782c9166c2 | ||
|
|
c365c2b9e5 | ||
|
|
135ea657fa | ||
|
|
ae39643568 | ||
|
|
bb37eb9d94 | ||
|
|
77cfc8bed9 | ||
|
|
8abb2f210b | ||
|
|
a70cbca5a9 | ||
|
|
bbca93470c | ||
|
|
a1aaf5cd7e | ||
|
|
b3d5f4ef18 | ||
|
|
316a3c591d |
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
[registries.gitea]
|
[registries.gitea]
|
||||||
index = "sparse+https://gitea.example.com/api/packages/crates/cargo/"
|
index = "sparse+https://gitea.melfely.com/api/packages/crates/cargo/"
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
name: Release-plz
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# Comment out branch restrictions until we are closer to done
|
||||||
|
# branches:
|
||||||
|
# - [main, master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
# Release unpublished packages.
|
||||||
|
release-plz-release:
|
||||||
|
name: Release-plz release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- &setup-git-user
|
||||||
|
name: Config Git User
|
||||||
|
run: |
|
||||||
|
git config --global user.name "ci-bot"
|
||||||
|
git config --global user.email "bot@email.melfely.com"
|
||||||
|
|
||||||
|
- &checkout
|
||||||
|
name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- &install-rust
|
||||||
|
name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- &install-cargo-semver
|
||||||
|
name: Install Cargo SemVer Checks
|
||||||
|
uses: taiki-e/install-action@fa23953489c080190314742a9b907f8e97c6767c # v2.87.10
|
||||||
|
with:
|
||||||
|
tool: cargo-semver-checks
|
||||||
|
|
||||||
|
- &install-release-plz
|
||||||
|
name: Install release-plz
|
||||||
|
uses: taiki-e/install-action@fa23953489c080190314742a9b907f8e97c6767c # v2.87.10
|
||||||
|
with:
|
||||||
|
tool: release-plz
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Run release-plz release
|
||||||
|
run: |
|
||||||
|
release-plz release --forge gitea --git-token ${{ secrets.GITEA_TOKEN }} --registry gitea --token "Bearer ${{ secrets.CARGO_REGISTRIES_GITEA_TOKEN }}"
|
||||||
|
|
||||||
|
# Create a PR with the new versions and changelog, preparing the next releases
|
||||||
|
release-plz-pr:
|
||||||
|
name: Release-plz PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-plz-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- *setup-git-user
|
||||||
|
- *checkout
|
||||||
|
- *install-rust
|
||||||
|
- *install-cargo-semver
|
||||||
|
- *install-release-plz
|
||||||
|
|
||||||
|
- name: Fill Credentials
|
||||||
|
run: |
|
||||||
|
git config --global credential.helper store
|
||||||
|
echo "https://ci-bot:${{ secret.GITEA_TOKEN }}@gitea.melfely.com" > ~/.git-credentials
|
||||||
|
|
||||||
|
- name: Run release-plz release-pr
|
||||||
|
run: |
|
||||||
|
release-plz release-pr --forge gitea --git-token ${{ secrets.GITEA_TOKEN }} --registry gitea
|
||||||
Generated
+1
-1
@@ -8,4 +8,4 @@ version = "0.1.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "example_lib"
|
name = "example_lib"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
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.1.1](https://gitea.melfely.com/melfely/rust_workflow_template/compare/example_lib-v0.1.0...example_lib-v0.1.1) - 2026-09-11
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- added pub fn sub()
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "example_lib"
|
name = "example_lib"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ pub fn add(left: u64, right: u64) -> u64 {
|
|||||||
left + right
|
left + right
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn sub(left: u64, right: u64) -> u64 {
|
||||||
|
left - right
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
@@ -10,5 +14,7 @@ mod tests {
|
|||||||
fn it_works() {
|
fn it_works() {
|
||||||
let result = add(2, 2);
|
let result = add(2, 2);
|
||||||
assert_eq!(result, 4);
|
assert_eq!(result, 4);
|
||||||
|
let result = sub(2, 2);
|
||||||
|
assert_eq!(result, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user